Having problem running android emulation with react native package

I'm having the same problem running the android emulation as the following guy in this link.

https://stackoverflow.com/questions/47605454/getting-this-error-android-repositories-cfg-could-not-be-loaded

react-native run-android
Scanning folders for symlinks in /Users/jloi/dev/lndr-mobile/node_modules (10ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
File /Users/jloi/.android/repositories.cfg could not be loaded.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':urbanairship-react-native'.
> Could not resolve all dependencies for configuration ':urbanairship-react-native:_debugPublishCopy'.
> Could not find any version that matches com.facebook.react:react-native:[0.40,).
Versions that do not match:
0.20.1
0.20.0
0.19.1
0.19.0
0.18.0
+ 12 more
Required by:
LNDR:urbanairship-react-native:unspecified

 

Please advise.  Thanks.

Didn't find what you were looking for?

New post

Comments

2 comments

  • Fixed it by adding build.gradle but now i get

    maven {
    url "https://maven.google.com"
    }
    maven {
    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    url "$rootDir/../node_modules/react-native/android"
    }
     

     

    :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
    :app:compileDebugJavaWithJavac
    :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
    /Users/jloi/dev/lndr-mobile/android/app/src/main/java/com/lndr/MainApplication.java:6: error: package com.urbanairship.reactnative does not exist
    import com.urbanairship.reactnative.ReactAirshipPackage;
    ^
    /Users/jloi/dev/lndr-mobile/android/app/src/main/java/com/lndr/MainApplication.java:30: error: cannot find symbol
    new ReactAirshipPackage(),
    ^
    symbol: class ReactAirshipPackage
    2 errors
    :app:compileDebugJavaWithJavac FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.

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

    BUILD FAILED

    0
  • Johnny,

    You shouldn't need to modify the gradle file.

    It seems like the first error originated from not having updated the react-native version.

    Can you ensure that you have the least 0.40 of the react-native module?

    0

Please sign in to leave a comment.