android - 迁移到 android studio 3.0.1

标签 android android-studio-3.0

你好,我正在尝试将我的项目迁移到 android 3.0.1,但我怎么会遇到以下错误:

Error:(1, 0) Unable to find method 'org.gradle.api.Project.getPluginManager()Lorg/gradle/api/plugins/PluginManager;'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

我试图将 google() 添加到存储库但是得到了 没有地方

我的 gradle 构建是:

apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.flashlight"
    minSdkVersion 14
    targetSdkVersion 14
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

最佳答案

将您的 gradle-wrapper.properties 更改为:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

关于android - 迁移到 android studio 3.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47916731/

相关文章:

java - 如何更改Unity Android插件包名称

java - 安卓 KeyPairGenerator + php openssl_public_encrypt

android - 为什么在我创建具有抽屉导航的应用程序时看到两个工具栏?

android - ActionBar 选项卡 - 固定和可滚动?

android - 将广播 Intent 从服务发送到应用程序类

android - 无法构建 Android APK - 任务 ':app:mergeDebugResources' 执行失败

java - 如何解决连接设备android studio中显示的模拟器超过一个的问题

android - 升级Android Studio 3,修改logcat界面

java-8 - Android Studio 3.0 Canary 2 仍然需要 Java 8 的 Jack

android - Android Studio 3.0 的 DexArchiveMergerException