[安卓] 21、android studio 疑难杂症

目录
  • 1 gradle问题
    • 1.1 gradle版本不匹配导致的错误:

.

1 gradle问题

1.1 gradle版本不匹配导致的错误:

背景:在导入telink ble ota安卓源码时遇到android_ota_for_sdk3.1.0_0719
报错:Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'
修复:在Android模式下找到Gradle Scripts文件夹下的gradle-wrapper.properties文件夹(该文件夹可以修改gradle版本):

Change Gradle properties 

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


Change distributional like below then it will works 
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

链接:https://stackoverflow.com/questions/58536705/unable-to-find-method-org-gradle-api-tasks-compile-compileoptions-setbootclassp

你可能感兴趣的:([安卓] 21、android studio 疑难杂症)