react-native Gradlew doesn't create app.aab

Viewed 6208

System Info

  1. react-native: 0.59.8
  2. android-studio: 3.3.1

Background

I'm making simple react-native app. I tried to upload my application on Google Play Store, but failed. I followed this documentation. As it said, I typed ./gradlew buildRelease on terminal. It results below.

> 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

Problem

Yes, it show BUILD SUCCESSFULL in 29s! but there is no android/app/build/outputs/bundle/release/app.aab or in any folder.

How to get app.aab file?

3 Answers

If you're trying to create a *.aab you need to use bundleRelease not buildRelease That will create the .aab as you are expecting.

When you generate android apk using ./gradlew buildRelease it automatically save in your project android/app/build/outputs/apk/release folder you can find app-release.apk if apk is generate successfully.

Another option is when you generate apk using android studio it give you options to save your apk in selected folder or directories.

Thanks

Just use ./gradlew bundleRelease.

After the process, go to YOUR APP NAME/android/app/build/outputs/bundle/release.

Related