-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-native run-android --variant=release does not work currently. #11586
Comments
Yeah so this was a problem I had. Turns out there was a PR created which changed this but the documentation was also not updated. I'll try and find the PRs for the change and docs (which hasn't merged). For now run:
PR for the change: #10867 (comment) |
Thanks I appreciate it. As long as there's something to run that works, i'm perfectly happy |
This is now fixed in v0.41.0-rc.0 and |
FYI @arthur31416, this appears to have broken again with v0.41.0-rc.2. I used |
This problem has been around since 0.41 and still exists on 0.43.0-rc.4. Should this PR be reopened, or should we create a new one? This issue has prevented me from ever being able to create an android release build for my project. |
it seems as though the 'installRelease' is not found in the root project in 0.43.0. |
So it seems to be because I forgot to include "signingConfig signingConfigs.release" in the "release" property of the "buildTypes" property of the app\build.gradle. |
Are there any way to test release builds on your simulator now? Im experiencing the same problems as above, running 0.43.0-rc.4 |
@trubin seems to be right. As soon as I configured my Android build for signing the release build, this problem went away. Its basically just a really bad error message. |
It would be nice if there were a way to install an APK which didn't require a signing config. I am just working with a sandbox app, and I wanted to see what the real performance would be like (since __DEV__ is very slow). |
Hey Guys, can you please try my fix below: react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ then: react-native run-android --variant=release |
@Ethan0007 It makes no difference for me. The 'bundle' command runs fine but the run-android still fails. |
@scarlac sir, can you please paste the said error. |
@Ethan0007 It was the exact error reported in this issue. For future reference, I solved it by following the signing configuration guide. The task |
@scarlac Good to hear that. |
See @scarlac response - helpful link on how to sign using configure in Android Studio Scroll to the Configure the build process to automatically sign your APK section |
@Ethan0007 Your bundle command did the trick for me. Otherwise the build worked and it installs on the phone, but would crash complaining: UncaughtException: java.lang.RuntimeException: Error calling AppRegistry.runApplication Now I am just confused why that is and why that is not done automatically? Do I need to run that everytime? |
Sir, please try to cd android then try to & ./gradlew clean. then & ./gradlew assembleRelease |
RN 0.45 |
Is there a way to just build and run in release mode with --dev=false without having to go through the signing step? I just want to do performance testing without creating a release-able APK. |
I had this error because i hadn't included the keystore passwords! as someone mentioned earlier, just a horribly misleading message! should be re-opened. |
I run react-native run-android --variant=release but the apk can not run on devices. My git project: https://github.com/lcd11001/NewYorkTimes.git Pls help me, thank you so much |
@lcd11001 can you please paste here the error message that you have encountered? |
@Ethan0007 Hello, here is my log on Samsung Android 4.4.2 This issue happens when I import Image or ImageBackground into project. // OK // ERROR after import my Thumnail component C:\Users\dan.luongcong>adb logcat |
Hello, com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 's.View.propTypes.style'), stack: => my solution is: import { NewsFeed.propTypes = { |
Description
cannot test release variant on android.
Reproduction
in console at root of project run
react-native run-android --variant=release
JS server already running.
Running /usr/local/opt/android-sdk/platform-tools/adb -s 192.168.56.101:5555 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installReleaseDebug)...
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong:
Task 'installReleaseDebug' not found in root project 'mysupercoolapp'.
Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Solution
I can get it to work doing
cd android && ./gradlew installRelease
. Maybe the react-native command needs to be remapped to a different gradle command?Additional Information
Someone else got this 7 hours ago on SO as well:
http://stackoverflow.com/questions/41263330/error-running-react-native-run-android-variant-release-task-installreleasede
The text was updated successfully, but these errors were encountered: