After carefully following the instructions in https://wix.github.io/react-native-navigation/#/docs/Installing, I am getting these errors after completing step 4 for Android:
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :react-native-navigation.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :react-native-navigation.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :react-native-navigation.
Show Details
Affected Modules: app
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app
Update dependencies in build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.2.0'
}
Disabled experimental feature for Gradle Only sync the active variant
, which leads to two more errors:
ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :react-native-navigation.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :react-native-navigation.
Show Details
Affected Modules: app
Preferences > Appearance & Behavior > System Settings > HTTP Proxy > No Proxy
Moved google()
to the top
buildscript{
ext {...}
repositories {
google()
mavenLocal()
...
}
...
}
allprojects {
repositories {
google()
...
}
}
Updated the gradle distributionUrl to 5.1.1-all and removed task wrapper
Set proxy both http and https in gradle.properties
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyPort=12345
org.gradle.jvmargs=-Xmx1234m
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=12345
Add the following
# android/settings.gradle
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')
Make sure you're using the new gradle plugin
# android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Update android/build.gradle
# android/build.gradle
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 19
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "28.0.0"
}
repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url 'https://jitpack.io' }
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
Update project dependencies
# android/app/build.gradle
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {...}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
...
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-navigation')
}
Sync project as necessary confirming that after step 4 the errors are produced
We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the react-native-navigation
tag.
I'm having the same problem.....
@tiagoalexbastos try ignoring the error and proceed to set up as instructed in the docs. I was able to get rid of those errors at step 7, but after having completed all the steps, when I run npm run android
, the app builds successfully but does not launch in the emulator. The emulator stays at the home screen.
I have also posted a question on stackoverflow about this
I'm having the same problem.....<
I have same in RN 0.6.4 and RNN v3
I have same in RN 0.6.4 and RNN v3
Did you ever get this fixed? I'm trying to upgrade from RN 59 to RN 0.60.2 right now and it is incredibly frustrating.
@inf3rnus I created a new RN project in 0.60.2 and copied the PodFile stucture then adding my own libs. That seemed to work.
@inf3rnus @mrquanghuy - Have you guys added missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
to the defaultConfig
in app/build.gradle
?
missingDimensionStrategy
Yes @ciawalsh, but the same problem here.
@inf3rnus @mrquanghuy - Have you guys added
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
to thedefaultConfig
inapp/build.gradle
?
Confirm it works by adding missingDimensionStrategy
, my react native version 0.61.5
Thanks
Most helpful comment
I have same in RN 0.6.4 and RNN v3