App build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Code App build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.jimclermonts.myapplication"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
在Android Studio或gradle设置中,我可以删除此外部存储库吗?我在Mac OS X上运行。
答案 0 :(得分:1)
我不确定你为什么试图排除该模块。 它有相同的包参考吗?
嗯,你必须尝试:
configurations {
compile { transitive = false }
runtime.exclude module:'weblogic'
}
或
dependencies {
compile (
[group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.6.2'],
[group: 'ch.qos.logback', name: 'logback-core', version: '1.0.0']
)
compile('ch.qos.logback:logback-classic:1.0.0') {
exclude group: 'org.slf4j', module: 'slf4j-api' //by both name and group
}
}
使用runtime.exclude
或exclude group
答案 1 :(得分:1)
从init.gradle
目录中的~/.gradle
删除已配置的回购。
答案 2 :(得分:0)
Inside~ / .gradle是一个名为init.gradle的文件。删除此文件的内容。