android - 每次遇到 RuntimeException、TransformException、ArgumentException 时,我都需要重建项目
问题描述
每次遇到 RuntimeException、TransformException、ArgumentException 时,我都需要重建项目。我认为问题出在 Gradle 文件中。
异常:RuntimeException:com.android.build.api.transform.TransformException:java.lang.IllegalArgumentException
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
multiDexEnabled true
applicationId "com.example.domin.zooapp"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.4.0'
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.10.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.1'
implementation group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.9.0'
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.maps:google-maps-services:0.2.5'
implementation 'com.google.maps.android:android-maps-utils:0.5'
}
我会感谢你的帮助
解决方案
删除 c\users\username\ .gradle .android 和 .androidstudio 文件夹对我有用
推荐阅读
- active-directory - 如何将 G Suite 用户与 Active Directory 域控制器同步?
- canvas - Fabricjs - 将画布背景缩放到画布边界内“包含”
- swift - 每 X 天本地通知 - Swift
- sql-server - 更新数千行中的几个字段
- c# - 使用键从字典中随机获取值 C# unity
- python - 如何在python中测试超类的顺序?
- java - 按对象的字符串字段(包括语言特定字符)对对象进行排序
- xml - Access VBA ImportXML 方法仅从 XML 文件中导入最后一条记录
- algorithm - 添加新顶点后更新最小生成树
- java - Java android List string sort string with number and with country letter