gpt4 book ai didi

android - react native 错误:Android任务已经创建。 Android Studio 3.3

转载 作者:行者123 更新时间:2023-12-03 05:38:50 25 4
gpt4 key购买 nike

更新Android Studio和Gradle后,我的react native应用无法构建。

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
}
}
}

resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
FAILURE: Build failed with an exception.

* Where:
Build file 'D:\mobileinstein.app\android\build.gradle' line: 32

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> Android tasks have already been created.
This happens when calling android.applicationVariants,
android.libraryVariants or android.testVariants.
Once these methods are called, it is not possible to
continue configuring the model.
> Android tasks have already been created.
This happens when calling android.applicationVariants,
android.libraryVariants or android.testVariants.
Once these methods are called, it is not possible to
continue configuring the model.
> Android tasks have already been created.
This happens when calling android.applicationVariants,
android.libraryVariants or android.testVariants.
Once these methods are called, it is not possible to
continue configuring the model.
> Android tasks have already been created.
This happens when calling android.applicationVariants,
android.libraryVariants or android.testVariants.
Once these methods are called, it is not possible to
continue configuring the model.

该错误似乎在“子项目”部分中,但我需要它。不知道此时该怎么办。

最佳答案

尝试先更改顺序google(),然后再更改应该起作用的jcenter()

关于android - react native 错误:Android任务已经创建。 Android Studio 3.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54297798/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com