React Native ERROR: задачи Android уже созданы. Android Studio 3.3 - PullRequest
0 голосов
/ 22 января 2019

Мое собственное приложение реакции не собирается после обновления Android Studio и Gradle.

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.

Ошибка, похоже, в разделе "подпроекты", но она мне нужна. Не уверен, что делать в этот момент.

1 Ответ

0 голосов
/ 22 января 2019

Попробуйте изменить порядок google(), затем jcenter(), который должен работать

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...