Skip to content

[Android] Upload package to device fails #2720

Closed
@ghost

Description

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:

:app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unable to upload some APKs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 20.863 secs
Could not install the app on the device, see the error above.```

Activity

ghost changed the title [-]Push built package to device fails[/-] [+]Upload package to device fails[/+] on Sep 15, 2015
ghost changed the title [-]Upload package to device fails[/-] [+][Android] Upload package to device fails[/+] on Sep 15, 2015
ghost
kmagiera

kmagiera commented on Sep 15, 2015

@kmagiera
Contributor

Do you have device debugging enabled on your phone? Do you see your device in the output of adb devices command?

ghost
mkonicek

mkonicek commented on Sep 15, 2015

@mkonicek
Contributor

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

flipace

flipace commented on Sep 15, 2015

@flipace
Contributor

I'm experiencing the same issue.

Huawei P8 - Android 5.0
OS: OSX 10.10.4

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.

ghost
mkonicek

mkonicek commented on Sep 15, 2015

@mkonicek
Contributor

Looks like there are two separate issues here:

  • "Unable to upload some APKs" from Gradle. This is Gradle-specific and I'd Google to find out why this is happening.
  • Getting the app to load JS from the host machine. The steps you described are very similar to the docs, looks like we should add the step to restart the app.

Do you need the step react-native start? I would expect react-native run-android to start the packager in a new window before failing in Gradle.

ghost
kmagiera

kmagiera commented on Sep 15, 2015

@kmagiera
Contributor

@peduxe Try entering android dir inside your project and running ./gradlew :app:installDebug from there.

ghost
kmagiera

kmagiera commented on Sep 15, 2015

@kmagiera
Contributor

Try running it with --debug

ghost

131 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wharsojo@heat@slott@fab1an@mfkp

        Issue actions

          [Android] Upload package to device fails · Issue #2720 · facebook/react-native