【发布时间】:2022-12-18 01:58:50
【问题描述】:
将 android gradle 更新为后,我无法运行本机 android 应用程序 “类路径‘com.android.tools.build:gradle:3.6.3’”并添加了“kotlin_version=‘1.6.0’”。
**我的安卓 --> build.gradle **
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 19
compileSdkVersion = 31
targetSdkVersion = 31
googlePlayServicesAuthVersion = "16.0.1"
kotlin_version='1.6.0' //add This change version with your installed kotlin version
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //add This
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral()
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
** 面临错误 **
此构建中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。 使用“--warning-mode all”来显示各个弃用警告。 见https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings 608 个可操作任务:2 个已执行,606 个是最新的 警告:将新 ns http://schemas.android.com/repository/android/common/02 映射到旧 ns http://schemas.android.com/repository/android/common/01 警告:将新 ns http://schemas.android.com/repository/android/generic/02 映射到旧 ns http://schemas.android.com/repository/android/generic/01
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'
我添加了 kotlin 版本并将 gradle 更改为“3.6.3”,我预计它会在添加 kotlin 和 gradle 版本更改后运行,但我无法打开应用程序。
【问题讨论】:
标签: android react-native