8

I am trying to use Android Studio to help develop a react native Android bridge module.

How do I resolve this error?

Error:Failed to resolve: com.facebook.react:react-native:+

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find any version that matches com.facebook.react:react-native:+.
     Searched in the following locations:
         file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/facebook/react/react-native/maven-metadata.xml
         file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/facebook/react/react-native/
         file:/Users/edward3/Library/Android/sdk/extras/android/m2repository/com/facebook/react/react-native/maven-metadata.xml
         file:/Users/edward3/Library/Android/sdk/extras/android/m2repository/com/facebook/react/react-native/
         file:/Users/edward3/Library/Android/sdk/extras/google/m2repository/com/facebook/react/react-native/maven-metadata.xml
         file:/Users/edward3/Library/Android/sdk/extras/google/m2repository/com/facebook/react/react-native/
     Required by:
         :android:unspecified

I opened the /MyBridgeModule/android/ folder using Android Studio.

My build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.1'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
       warning 'InvalidPackage'
    }
}

dependencies {
    compile "com.facebook.react:react-native:+"
}

Thanks in advance,

1 Answer 1

4

This can be possible when using + in reference of Version. Try to use specific version when going offline + may not work with Offine gradle build in android studio or may this refer to this issue GitHub Issue referene to same

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.