尝试运行本机运行android时出现错误。我不知道为什么会收到此错误。
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
android \ build.gradle如下。
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 ':react-native-vector-icons'.
> Could not resolve all dependencies for configuration ':react-native-vector-icons:classpath'.
> Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.
渐变版本:3.3, 插件:2.2.3
答案 0 :(得分:0)
react-native-vector-icons: "^6.0.2"
npm i react-native-vector-icons
cd android && ./gradlew clean
。 答案 1 :(得分:0)
更改依赖项:
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}
收件人:
dependencies {
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}
还将更改构建脚本依赖项以使用:classpath 'com.android.tools.build:gradle:2.2.3'
和maven { url "https://dl.bintray.com/android/android-tools/" }
代替google()
所以您的../node_modules/react-native-vector-icons/android/build.gradle应该如下所示:
buildscript {
repositories {
maven { url "https://dl.bintray.com/android/android-tools/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}
repositories {
mavenCentral()
}
dependencies {
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}