好日子朋友,
错误
:app:compileDebugJavaWithJavac error: error reading C:\ .... \.android\build-cache\167256a7a343274ac6d230f06a5526cf83b55ac4\output\jars\classes.jar; error in opening zip file
也是一样,但以cannot read zip file
。之后,我明显会遇到各种错误,例如package android.support.v7.app does not exist
等。
我尝试过清洁,重建,清理.android\build-cache
等等,什么也没做。我也看过这里提供的其他答案,但没有一个解决了这个问题。
我正在运行jdk1.8.0_40作为JDK
这是我的顶级学生:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
和我的应用程序gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "es.sample.android.myoffice"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
apply plugin: 'android-apt'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.google.firebase:firebase-config:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services-appinvite:10.0.1'
compile 'com.firebase:firebase-jobdispatcher:0.5.2'
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
}
apply plugin: 'com.google.gms.google-services'
谢谢!
新编辑
显然只影响到:
Error:(18, 30) error: package android.support.v7.app does not exist
答案 0 :(得分:1)
在疯狂并尽我所能的努力之后,我想出了一个解决方案。
我已经回到Android支持库版本45.由于一些奇怪的原因,版本46导致android.support.v7.app
的所有混乱
请执行以下操作: