标签:tor jce file 升级 pil 报警 services http 报错
项目根目录下的build.gradle
1.buildscript和allprojects的repositories中添加google()
2.dependencies中的classpath中将gradle版本修改为对应版本,如3.1.2
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.1.2‘
}
}
allprojects {
repositories {
google()
jcenter()
}
}
1.删除buildToolsVersion。Android Studio3.0之后不需要再指定buildToolsVersion,每个版本的Android Gradle插件都有默认版本的构建工具,不删除只会报警告,但是这句指定构建版本的语句会被忽略
2.dependencies中 compile 替换为 implementation ,testCompile 替换为 testImplementation ,androidTestCompile 替换为 androidTestImplementation
dependencies {
implementation fileTree(dir: ‘libs‘, include: [‘*.jar‘])
implementation ‘com.android.support:appcompat-v7:27.1.1‘
testImplementation ‘junit:junit:4.12‘
androidTestImplementation ‘com.android.support.test:runner:1.0.2‘
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2‘
}
项目根目录下的gradle/wrapper文件夹下的gradle-wrapper.properties文件
修改 distributionUrl 的地址
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
注意:多数教程中都没有提及这个文件,如果不改此处的地址,编译报错
Gradle DSL method not found: ‘google()‘ Possible causes:
The project ‘app‘ 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).
标签:tor jce file 升级 pil 报警 services http 报错
原文地址:https://www.cnblogs.com/tc310/p/9179498.html