Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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,

like image 310
Ed of the Mountain Avatar asked Aug 09 '16 13:08

Ed of the Mountain


1 Answers

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

like image 150
Dipali Shah Avatar answered Sep 29 '22 17:09

Dipali Shah