when i built the APK with react native in windows with the debug version it worked fine (also in the emulator) and installed in the real device, but when i tried to build with the release version i saw the message ( app not installed ) , the problem is i have no way to trace or debug this problem (probably i don't know ), i tried to fix this problem for about one week ,so i ask for some help here , thanks
gradlew assembleDebug --- installed fine
gradlew assembleRelease --- app not installed
also i added this lines to gradle.properties file in my project
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=123456
MYAPP_RELEASE_KEY_PASSWORD=123456
other details
react native version 0.48 ---
my device android version 5.0
windwos version 8.1
the project is AwsomeProject --- the initial projects to test
NOTE : in all situations i see the message "BUILD SUCCESSFUL" and the file generated without any problem or any error message
$ cd android && gradlew assembleRelease creates a signed apk.
(Note: Don't forget to cd out of <MyProject>/android after creating a signed apk back the root of your directory)
$ react-native run-android --variant=release will install the signed apk onto your device
It is all about adding this line in the gradle.properties file
signingConfig signingConfigs.release
hope it help someone
You need to generate some certificates to be able to run your signed APK , in the RN docs that is documented.
Please check this out RN Docs
Related
I' m working on this cocos2dx game project, that uses gradle for building for Android in linux.
I can build apks for release of debug without problems using
./gradlew assembleRelease or ./gradlew assebleDebug
But now, I have to build an app bundle in order to upload on google play store.
I tried ./gradlew bundleRelease and it seems the build was ok since I did not get any error message, but a Build Sccessfull message.
Despite that, I was not able to find the aab file that should be generated. I look for the /app/build/outputs/ and there is only the apk folder, not the bundle folder.
Any Ideas ?
Thanks in advance people.
I recently started working with flutter. I have been making several test applications. They all work well on emulators.
But now I want to be able to use them on my cell phone.
I took the APK that is generated when I run the application in the emulator, indicated in this route:
But it always fails to install
So far, my applications are simple, Hello world, Add numbers, etc.
Any ideas?
How should I do it correctly?
First: Open your Terminal/Shell/Command Line and open the directory of the Flutter App in there (cd PATH_TO_YOUR_FILE)
You probably want to create a profile-mode apk for testing. This build still helps debugging while having the speed of the --release version:
This creates a single APK which works on all devices (x64, arm64 and arm), it's probably pretty big:
flutter build apk --profile
If the people who install your App know which devices they have, you can use the split-per-abi command which creates three different APKs for all architectures (x64, arm64 and arm)
flutter build apk --profile --split-per-abi
If you want to have a release build, you can use what #Niteesh commented:
flutter build apk --release --split-per-abi
Release-builds can be uploaded to Google-Play (also the internal testing)
Read more: https://flutter.dev/docs/testing/build-modes
the apk that is generated when you run the app is the debug-apk, it contains lots of overheads which helps in flutter hot reload and hot restart. The size of debug apk version is also a lot.
use this command to generate release version of apk
flutter build apk --split-per-abi
After execution of the command, you get the path of the apk, something like this
√ Built build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk (7.0MB).
Then you can install that apk on your phone
I am able to see debug console in the terminal when I am run the command flutter run
but when I run the command flutter build apk --split-per-abi
it's given me two application
so when I am installing one of this apk in my android phone, I am not able to see any debug output or my print.
I want to know how can I do this because my app is working fine in debug mode but when I installed flutter build apk --split-per-abi this apk, my app crash after two or three pages because of an external plugin.
How can I check debug console when I am installed the app through apk?
flutter attach
and then start your application. Or using adb logcat:
adb logcat *:S flutter:V
after upgrading my react-native app to version 0.60.5, the application works just fine in debugging mode but when i try to get the android release files of my app by running this command:
react-native run-android --variant=release
the progress gets stuck at this line:
> :app:transformClassesAndResourcesWithR8ForRelease
and hangs on forever
note: i tried to delete the build and gradle folders and run ./gradlew clean but didn't work either
The command you want to use is a command to test APK, and you need to set it up to sign the app before that.
Note: that --variant=release is only available if you've set up
signing as described above.
See this official document to create a release app for signature and upload keys.
Is it possible to build app and copy file *.apk directly on smartphone and run it there.
And I don't mean running on device debug version like on this solution:
https://facebook.github.io/react-native/docs/running-on-device.html
Just copy, install and run like release version without signed APK.
Thank you.
Go to toolbar Click on Build -> Build APk