【问题标题】:react-native Gradlew doesn't create app.aabreact-native Gradlew 不会创建 app.aab
【发布时间】:2019-10-25 12:00:06
【问题描述】:

系统信息

  1. 反应原生:0.59.8
  2. 安卓工作室:3.3.1

背景

我正在制作简单的 react-native 应用程序。 我尝试将我的应用程序上传到 Google Play 商店,但失败了。 我关注了this documentation。正如它所说,我在终端上输入了./gradlew buildRelease。结果如下。

> Configure project :react-native-voice
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/mac88/Desktop/Projects/voice-car-v2/NativeApp/android/app/build/generated/assets/react/release/index.android.bundle
info Done writing bundle output
info Copying 13 asset files
info Done copying assets

> Task :react-native-gesture-handler:compileReleaseJavaWithJavac
Note: /Users/mac88/Desktop/Projects/voice-car-v2/NativeApp/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL in 29s
63 actionable tasks: 10 executed, 53 up-to-date

问题

是的,它显示BUILD SUCCESSFULL in 29s!但没有android/app/build/outputs/bundle/release/app.aab 或在任何文件夹中。

如何获取app.aab文件?

【问题讨论】:

  • 查看这里android/app/build/outputs/apk/release你可以看到app-release.apk有生成成功
  • @HardikVirani OMG,我刷新了 VSCode,它现在出现了!谢谢:D

标签: typescript react-native react-native-android


【解决方案1】:

只需使用./gradlew bundleRelease。

流程结束后,前往YOUR APP NAME/android/app/build/outputs/bundle/release。

【讨论】:

    【解决方案2】:

    如果您尝试创建 *.aab,则需要使用 bundleRelease 而不是 buildRelease 这将按预期创建 .aab。

    【讨论】:

    • 这是一个更有帮助的答案,因为该解决方案不建议使用其他工具,例如 android studio,而只修复要在终端中执行的命令。
    【解决方案3】:

    当您使用./gradlew buildRelease生成android apk时,它会自动保存在您的项目android/app/build/outputs/apk/release文件夹中,如果apk生成成功,您可以找到app-release.apk。

    另一个选项是当您使用 android studio 生成 apk 时,它会为您提供将 apk 保存在选定文件夹或目录中的选项。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多