android studio升级3.0,gradle升级4.1以后项目报错总结

Could not find com.android.tools.build:gradle:3.0.0.的问题

具体信息如下

Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
    project :
Add Google Maven repository and sync project
Open File

原因是什么这个后面再找一下资料

对应的解决方法是在gradle中的build.gradle中添加谷歌()

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

sync之后会让你升级组件,点击升级之后对应报错消息

ERROR: Could not find method jackOptions() for arguments 的问题

原因:

由于google支持了Jack(Java Android Compiler kit),开启之后对应报错可以进行去掉
对应的支持点可以参考

Google 又弃坑了,Jack+Jill vs. javac+dx

解决:

最简单的解决方法是将对应的Jack关闭掉
在app里面的build.gradle中的

jackOptions {
            enabled true
        }

去掉,就解决

ERROR: The minSdk version should not be declared in the android manifest file

ERROR: The minSdk version should not be declared in the android manifest file.You can move the version from the manifest to the defaultConfig in the build.gradle file.
Remove minSdkVersion and sync project
Affected Modules: app

原因:

在Android Studio 3.0之后,app的AndoridManifest.xml中要把SDK的最小版本去掉,这些设置必须要设置在gradle志中.

解决:

去掉AndroidManifest.xml中的

你可能感兴趣的:(android studio升级3.0,gradle升级4.1以后项目报错总结)