【发布时间】:2016-07-26 17:08:17
【问题描述】:
我完成了 windows 的 react-native 设置,顺利完成了以下操作(并安装了 Android Studio)。
choco install nodejs.install
choco install python2
npm install -g react-native-cli
然后我在 Android Studio 中打开了这个 react-native datetime 包的android part。
但是,当我尝试清理和重建时,当它到达 react-native compile dependency 时出现错误
compile 'com.facebook.react:react-native:+'
提示找不到已安装的 react-native。
完整的错误是:
Error:A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/facebook/react/react-native/maven-metadata.xml
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/facebook/react/react-native/
file:/C:/Users/funkyeah/AppData/Local/Android/sdk/extras/android/m2repository/com/facebook/react/react-native/maven-metadata.xml
file:/C:/Users/funkyeah/AppData/Local/Android/sdk/extras/android/m2repository/com/facebook/react/react-native/
file:/C:/Users/funkyeah/AppData/Local/Android/sdk/extras/google/m2repository/com/facebook/react/react-native/maven-metadata.xml
file:/C:/Users/funkyeah/AppData/Local/Android/sdk/extras/google/m2repository/com/facebook/react/react-native/
Required by:
:android:unspecified
我确实注意到包的package.json 没有 react-native 作为依赖项,或者根本没有任何依赖项...应该所有 react-native 包都具有 react-native 作为根包中的依赖项.json?
【问题讨论】:
标签: android android-studio gradle react-native