Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native Gradlew doesn't create app.aab

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?

like image 221
Byeongin Yoon Avatar asked Jun 11 '19 05:06

Byeongin Yoon


People also ask

How to debug react native app in Android using terminal?

Go to your android/app folder in terminal and create a debug key with the below code, So for production ready code, go to the root of your react native app folder and copy and paste the code below in terminal and do as follows, The alias name must be set by you.

How do I build an app from a Gradle release?

Use gradlew bundleRelease to generate an app bundle (.aab file) and gradlew assembleRelease to generate an apk (.apk file). To install a release on your emulator, use react-native run-android --variant=release. I hope this helps Show activity on this post. I made a file that called build.sh .

How to make react native app production ready?

So for production ready code, go to the root of your react native app folder and copy and paste the code below in terminal and do as follows, The alias name must be set by you.

Should I enable app signing by Google Play in React Native?

If you are migrating from previous version of React Native chances are your app does not use App Signing by Google Play feature. We recommend you enable that in order to take advantage from things like automatic app splitting.


2 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.

like image 52
TallOrderDev Avatar answered Sep 22 '22 08:09

TallOrderDev


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

like image 26
Hardik Virani Avatar answered Sep 24 '22 08:09

Hardik Virani