-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
[Android] Upload package to device fails #2720
Comments
So I managed to enable the remote dev server via wi-fi and got everything to work generating a debug apk. It works for now. Steps (for those who are interested):
* I use Pushbullet and it works like charm for this kind of tasks |
Do you have device debugging enabled on your phone? Do you see your device in the output of |
@kmagiera correct, I tried under adb tcpip (wifi) -> adb connect and usb and got the same error. |
Glad you got this to work. "Unable to upload some APKs" is a generic Gradle error, do you have spaces in your project name by chance? Google gives me: https://code.google.com/p/android/issues/detail?id=180674 |
I'm experiencing the same issue. Huawei P8 - Android 5.0 Enabled usb debugging and allowing all sources. My project name does not contain any special characters or spaces. Edit: I can confirm that the remote dev server workaround by @peduxe works though. |
@mkonicek nope the project name is just: |
Looks like there are two separate issues here:
Do you need the step |
@mkonicek It doesn't get to the point of uploading the app to my device, fails on the first step - also no new window (terminal tab?) is open during The react-native server needs to be executing before running |
@peduxe Try entering |
@kmagiera same errors. |
Try running it with |
@kmagiera nothing, but now outputs much more verbose logs |
Do you mind posting your logs here? |
Met the same issue. Device: MEIZU m2 note - Android 5.1 BTW, the workaround provided by @peduxe is also worked for me. The same application can run on my Nexus 7 (Android 5.1) without issues. |
@conechan you can connect with adb reverse, no need to set the host machine. Make sure your device is connected via USB and run |
I also met this problem. :app:installDebug I try to use android studio with project, and that's ok. |
@everplus yep it does work with AS, I believe it's the adb task to deploy the apk being used by react-native does not work for every device, I tested with a S5 and it worked. |
I have the same problem, make sure you have allocate enough SD storage for your AVD. That's works for me! |
@lazybios But i'm deploying to my own device, not the emulator :) |
I got the same error after I call
then I call react-native run-android
|
@conechan, @everplus, @flipace So I just downgraded this classpath from the gradle build files, from 1.3.0 (there's also a newer version: 1.3.1 but it doesn't work as well) to 1.2.0 and successfully it pushed the apk to my device and started the activity, although there's a new error. Prolly worth a look now:
|
Thanks for investigating @peduxe |
@kmagiera It didn't, the error persists. |
I had the same error too, with a virtual device. I got around it by deleting a couple of my apps that were installed on the device, including the previous version of the react native app that I was trying to test. Once I did that the error went away. |
@yanni858 Well weird, I can't find way to debug any app anymore, even pushing the apk manually. Probably it's a network problem here I got here... |
Seems like downgrade gradle to 1.2.3 solved my problem with Xiaomi Redmi Note 3. But I have white screen after install. Actually the same bug as here. |
Interesting update: I wasn't able to get the build process to deploy to an Android 7.0 device (Nexus 5x) when using gradle 1.2.*. Once I updated it to gradle 1.3.1, I can deploy to the Nexus device again. |
It works with gradle version 1.2.3, but the original default version is 1.3.1. |
@DysaniazzZ did u also downgrade your react-native version? |
@ponty96, not entirely sure what the root cause is, but this worked for me:
|
@ponty96 Nope, I just downgrade the gradle version and it works. |
I created a project in react native my android\build.gradle has classpath 'com.android.tools.build:gradle:2.0.0' when i am running command react-native run-android apk generated but not uploaded on the connected device but when i am running command adb install -r ./android/app/build/outputs/apk/app-debug.apk apk uploaded and working fine also when i change my android\build.gradle classpath 'com.android.tools.build:gradle:2.0.0' to 'com.android.tools.build:gradle:1.2.3' react-native run-android works fine for me but some plugin are not working |
the same issue. |
Changing the gradle version to 1.2.3 in |
Same here, fixed with 1.2.3 in |
I had the same issue when running I fixed it by recreating a new emulator with the proper CPU/ABI: I didn't need to change Gradle version. |
You might want to uninstall the application from your device, and |
I had to type: Wait a moment then run: adb devices This will show you the DEVICE_ID (which i'm gonna call XYZ) of your device running android. It is usually its IP adress followed by the port 5555 (usually, not always). react-native run-android --deviceId XYZ The important part was the --deviceId XYZ. Without this, the apk would never get uploaded to the phone. Then, the app launched with a red screen... i had to shake it, dev settings, adjust the "debug server host & port for device", putting my computer's IP address and port, like this: 192.168.0.15:8081 Lastly, i had to shake my phone again and select REALOD... it worked for me! |
@thiagoufg thank you so much! Really works with |
@thiagoufg thanks for steps, it worked for me. but still giving me error when reload:
Edit: I got it fixed, i was mis-understanding by putting mobile_device IP instead of laptop IP :) |
@thiagoufg this is the lonly solution that worked for me, thank you ! |
I solved the problem putting |
@thiagoufg your solution works for me putting --deviceId right after react-native run-android |
Guys & Girls, I faced in the same issues during one night and the solution it's OFTEN to check dependencies linked in your project. If you have removed package in your package.json and previously linked with So the solution is : I assume your device is connected, so check : 1 ) edit file "android/app/src/main/java/com/wespeek/MainApplication.java" and remove import & new packageName()
|
@**yaofly2012 ** If your phone is xiaomi ,you must close optimization in developer options |
@thiagoufg ur the man! |
I'm getting
|
I'm trying to build the default example but it fails uploading the package to my device (Android 5.0):
Exceptions thrown while deploying.
command:
react-native run-android
OS: Linux 15.04 64-bits
Log:
The text was updated successfully, but these errors were encountered: