React本机签名的apk构建失败的lint错误

时间:2018-06-08 16:52:57

标签: android react-native build.gradle

在构建反应原生应用程序的签名apk时遇到此错误。在互联网上搜索了许多解决方案但没有任何效果。试图把它放在应用程序的gradle文件中,没有运气

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    } 

无法解析所有配置文件':react-native-navigation:lintClassPath'。

  

找不到com.android.tools.lint:lint:26.1.2。         在以下位置搜索:             文件:/Users/apple/Library/Android/sdk/extras/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             文件:/Users/apple/Library/Android/sdk/extras/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar             文件:/Users/apple/Library/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             文件:/Users/apple/Library/Android/sdk/extras/google/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar             文件:/Users/apple/Library/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             文件:/Users/apple/Library/Android/sdk/extras/android/m2repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar             文件:/Users/apple/.m2/repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             文件:/Users/apple/.m2/repository/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar             https://jcenter.bintray.com/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             https://jcenter.bintray.com/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar             文件:/Users/apple/Desktop/wecora/node_modules/react-native/android/com/android/tools/lint/lint/26.1.2/lint-26.1.2.pom             文件:/Users/apple/Desktop/wecora/node_modules/react-native/android/com/android/tools/lint/lint/26.1.2/lint-26.1.2.jar         要求:             项目:react-native-navigation> com.android.tools.lint:不起毛的gradle:26.1.2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 40s
85 actionable tasks: 81 executed, 4 up-to-date

1 个答案:

答案 0 :(得分:4)

对于任何面临同样问题的人,我通过添加来解决它 项目的gradle文件中的maven { url 'https://maven.google.com' }

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}