Skip to content
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

Unable to run on Android simulator after upgrade to 0.57.0 #21121

Closed
3 tasks done
damianthekreeeytor opened this issue Sep 14, 2018 · 14 comments
Closed
3 tasks done

Unable to run on Android simulator after upgrade to 0.57.0 #21121

damianthekreeeytor opened this issue Sep 14, 2018 · 14 comments
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@damianthekreeeytor
Copy link

damianthekreeeytor commented Sep 14, 2018

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.

@react-native-bot react-native-bot added the Platform: Android Android applications. label Sep 14, 2018
@hramos hramos added the Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. label Sep 14, 2018
@benonymus
Copy link

benonymus commented Sep 15, 2018

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

@shervonw
Copy link

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

@mike-niemand
Copy link

mike-niemand commented Sep 16, 2018

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.

@mike-niemand
Copy link

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?

@CarGuo
Copy link

CarGuo commented Sep 17, 2018

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

@mike-niemand
Copy link

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

What version of React are you running?

@CarGuo
Copy link

CarGuo commented Sep 17, 2018

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

@mike-niemand
Copy link

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"

@CarGuo
Copy link

CarGuo commented Sep 18, 2018

i resolve it by this: https://stackoverflow.com/questions/49962174/react-native-build-error-for-android-after-gradle-upgrade

update my JDK version and restart cmd

@kelset
Copy link
Collaborator

kelset commented Sep 18, 2018

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 🤷‍♂️

@kelset kelset added 📋No Repro Steps and removed Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. labels Sep 18, 2018
@damianthekreeeytor
Copy link
Author

damianthekreeeytor commented Sep 18, 2018

@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

@damianthekreeeytor
Copy link
Author

damianthekreeeytor commented Sep 18, 2018

@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.

@fantasy525
Copy link

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

i 'm same with you,help

@damianthekreeeytor
Copy link
Author

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

@facebook facebook locked as resolved and limited conversation to collaborators Oct 11, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants