React-native: Unable to run on Android simulator after upgrade to 0.57.0

Created on 14 Sep 2018  ·  14Comments  ·  Source: facebook/react-native

Environment Variables

PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/Damian/Scripts:/Users/Damian/Library/Android/sdk/tools:/Users/Damian/Library/Android/sdk/platform-tools:/Users/Damian/Library/Android/sdk/tools/bin:/Users/Damian/Library/Android/sdk/emulator:/Users/Damian/Library/Python/2.7/bin
ANDROID_HOME=/Users/Damian/Library/Android/sdk

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 20.93 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.10.0 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 26.0.3, 27.0.3
        API Levels: 23, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.0 => 0.57.0
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

After an upgrade to react-native 0.57.0, I am able to run on iOS simulator via react-native run-ios but when trying to build on android via react-native run-android it fails with the following error:

* What went wrong:
A problem occurred configuring project ':app'.
> Could not generate a proxy class for class com.android.build.gradle.tasks.BuildArtifactReportTask.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 10s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

I tried upgrading my version of Java to build 1.8.0_181-b13 and deleting the ~/.gradle and rebuilding, but still experiencing the same issue.

The case is true even from a brand new install using react-native init

I followed all the necessary steps from Building Projects with Native Code for Android from the Getting Started guide to verify my environment is setup correctly still no-joy. Maybe I am missing something but when I revert to 0.56.0 it works fine.

Any help would be appreciated.

Android Locked

Most helpful comment

@kelset

Steps to reproduce

> react-native init <appName>
> cd <appName>
> react-native run-android

Is there any specific environment required here?

My specific problem here shown with the following error:

A problem occurred configuring project ':app'.
> Could not generate a proxy class for class com.android.build.gradle.tasks.BuildArtifactReportTask.

When building in Android studio everything works fine.

I have also added @babel/core 7.0 and babel-core 7.0.0-bridge-0 to satisfy the dependency warnings.

Updated to React v16.5.1 as well.

All 14 comments

after upgrading to this version I cannot run my app on android too, but having another issue in metro bundler:

error: bundling failed: Error: Unable to resolve module schedule/tracking from /mnt/c/Projects/COBRn/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js: Module schedule/tracking does not exist in the Haste module map

OK so the sad/funny case is this: on windows 10 I need v0.56 to run the developer build - react-native android-run, but with that I cannot build signed apk, so to do that I need to update to v0.57.
I guess this works as a workaround

I am also experiencing the same issue as @damianthekreeeytor

NOTE: I haven't modified ANY code in this project.

Description

* What went wrong:
A problem occurred configuring root project 'testee'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve commons-codec:commons-codec:1.6.
     Required by:
         project : > com.android.tools.build:gradle:3.1.4 > com.android.tools.build:gradle-core:3.1.4 > com.android.tools.build:builder:3.1.4 > com.android.tools:sdklib:26.1.4 > org.apache.httpcomponents:httpclient:4.2.6
      > Could not resolve commons-codec:commons-codec:1.6.
         > Could not parse POM https://jcenter.bintray.com/commons-codec/commons-codec/1.6/commons-codec-1.6.pom
            > Could not resolve org.apache.commons:commons-parent:22.
               > Could not resolve org.apache.commons:commons-parent:22.
                  > Could not get resource 'https://jcenter.bintray.com/org/apache/commons/commons-parent/22/commons-parent-22.pom'.
                     > Read timed out
   > Could not resolve org.glassfish.jaxb:jaxb-core:2.2.11.
     Required by:
         project : > com.android.tools.build:gradle:3.1.4 > com.android.tools.build:gradle-core:3.1.4 > com.android.tools.build:builder:3.1.4 > com.android.tools:sdklib:26.1.4 > com.android.tools:repository:26.1.4 > org.glassfish.jaxb:jaxb-runtime:2.2.11
      > Skipped due to earlier error
   > Could not resolve org.jvnet.staxex:stax-ex:1.7.7.
     Required by:
         project : > com.android.tools.build:gradle:3.1.4 > com.android.tools.build:gradle-core:3.1.4 > com.android.tools.build:builder:3.1.4 > com.android.tools:sdklib:26.1.4 > com.android.tools:repository:26.1.4 > org.glassfish.jaxb:jaxb-runtime:2.2.11
      > Skipped due to earlier error
   > Could not resolve com.sun.xml.fastinfoset:FastInfoset:1.2.13.
     Required by:
         project : > com.android.tools.build:gradle:3.1.4 > com.android.tools.build:gradle-core:3.1.4 > com.android.tools.build:builder:3.1.4 > com.android.tools:sdklib:26.1.4 > com.android.tools:repository:26.1.4 > org.glassfish.jaxb:jaxb-runtime:2.2.11
      > Skipped due to earlier error

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

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 21s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Steps to reproduce

react-native init your-project
cd /path-to-your-project
react-native run-android

v 0.57

I'm getting the same on iOS.

_error: bundling failed: Error: Unable to resolve module schedule/tracking from path-here/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js: Module schedule/tracking does not exist in the Haste module map_

Project does build in Xcode but borks when running it on the emulator.

Edit: Running 'react-native run-ios' throws a different error:

error: failed writing record '_uuid_t.h-1VNQUIHUMFTZ3': failed to rename '/<path>/ios/build/Index/DataStore/v5/records/Z3/_uuid_t.h-1VNQUIHUMFTZ3-temp-922c89c5' to <path>/ios/build/Index/DataStore/v5/records/Z3/_uuid_t.h-1VNQUIHUMFTZ3': File exists 1 warning and 1 error generated.

Edit: Strange. It's also happening in Android. Before moving to iOS I had a working build in Android. Investigating...

Edit: Upgrading to React 16.5.1 corrected this issue on Android. Testing for iOS now.

Upgrading React to version 16.5.1 (with React Native 0.57) has corrected this issue in both Android and iOS for me. Can someone verify?

I can build with Android Studio, but fail wiht react-native run-android cmd in win10

I can build with Android Studio, but fail wiht react-native run-android cmd in win10

What version of React are you running?

I can build with Android Studio, but fail wiht react-native run-android cmd in win10

What version of React are you running?

"react": "^16.5.0",
"react-native": "0.57.0",

@mike-niemand

I can build with Android Studio, but fail wiht react-native run-android cmd in win10

What version of React are you running?

"react": "^16.5.0",
"react-native": "0.57.0",

@mike-niemand

Try "react": "^16.5.1"

So cleaning up dependencies and upgrading to latest (React, JDK, etc) is the solution? Or is there an actual issue here?

The repro steps are not showing any issue to me 🤷‍♂️

@CarGuo I tried updating my JDK version as well. Also when I try to build from Android Studio it works, not with react-native run-android command. I'm running on MacOS

@kelset

Steps to reproduce

> react-native init <appName>
> cd <appName>
> react-native run-android

Is there any specific environment required here?

My specific problem here shown with the following error:

A problem occurred configuring project ':app'.
> Could not generate a proxy class for class com.android.build.gradle.tasks.BuildArtifactReportTask.

When building in Android studio everything works fine.

I have also added @babel/core 7.0 and babel-core 7.0.0-bridge-0 to satisfy the dependency warnings.

Updated to React v16.5.1 as well.

I can build with Android Studio, but fail wiht react-native run-android cmd in win10

i 'm same with you,help

Update: On MacOS download JDK8 from the following:

Java SE Development Kit 8 Downloads

Important delete gradle rm -rf ~/.gradle

Run react-native run-android

Was this page helpful?
0 / 5 - 0 ratings