自从我更新了Android Gradle之后,我的铃声应用程序出现了问题,在复制文件和权限方面似乎存在问题 (我注意到在清单中 android.permission.WRITE_SETTINGS是红色下划线,我想那里就是问题所在)。
同样的代码在我的旧项目中完美运行,唯一的区别在于Gradle,所以我尝试了网上的一些教程来降级它,但我失败了。
我试图在 gradle-wrapper.properties(Gradle Version)中更改 distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip 到之前对我有效的版本,但我得到了4.4是最小值的消息。
然后我尝试在 build.gradle(Project) 中降级
但只成功将其降级到 classpath 'com.android.tools.build:gradle:3.0.1' 但这并没有解决我的问题,因为工作版本是 2.3.3
和 distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
当我尝试与2.3.3同步时,我遇到了错误。
同样的代码在我的旧项目中完美运行,唯一的区别在于Gradle,所以我尝试了网上的一些教程来降级它,但我失败了。
我试图在 gradle-wrapper.properties(Gradle Version)中更改 distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip 到之前对我有效的版本,但我得到了4.4是最小值的消息。
然后我尝试在 build.gradle(Project) 中降级
但只成功将其降级到 classpath 'com.android.tools.build:gradle:3.0.1' 但这并没有解决我的问题,因为工作版本是 2.3.3
和 distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
当我尝试与2.3.3同步时,我遇到了错误。
Gradle DSL method not found: 'google()'
Possible causes:<ul><li>The project 'MyProject' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.1.4 and sync project</li><li>The project 'MyProject' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>
有人能告诉我解决问题的正确方法和逐步解决方案吗?