gradle,无法展开ZIP appcompat-v7:19.0.1

mrr*_*aat 21 android android-appcompat gradle android-studio

我有一个android studio adn gradle导入appcompat-v7的问题.

所以这是我在src目录中的build.gradle

apply plugin: 'android'
apply plugin: 'android-apt'
def AAVersion = '3.0.1'

    android {
        compileSdkVersion 19
        buildToolsVersion "19.0.1"

        defaultConfig {
            minSdkVersion 10
            targetSdkVersion 19
            versionCode 1
            versionName "1.0"
            packageName "com.test"
        }
        buildTypes {
            release {
                runProguard false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
    }

    apt {
        arguments {
            resourcePackageName android.defaultConfig.packageName
            androidManifestFile variant.processResources.manifestFile
        }
    }

    dependencies {

        // You must install or update the Support Repository through the SDK manager to use this dependency.
        // The Support Repository (separate from the corresponding library) can be found in the Extras category.
        compile 'com.android.support:support-v4:19.0.1'

        // You must install or update the Support Repository through the SDK manager to use this dependency.
        // The Support Repository (separate from the corresponding library) can be found in the Extras category.
        compile 'com.android.support:appcompat-v7:19.0.1'

        // android annotations
        compile "org.androidannotations:androidannotations-api:$AAVersion"
        apt "org.androidannotations:androidannotations:$AAVersion"
    }
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误

Execution failed for task ':app:prepareComAndroidSupportAppcompatV71901Library'.
> Could not expand ZIP '/opt/android-sdk/extras/android/m2repository/com/android/support/appcompat-v7/19.0.1/appcompat-v7-19.0.1.aar'.
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决我的问题?Thx提前

pyu*_*s13 22

似乎问题在于目录权限.

检查并尝试以下事项:

  • 检查你是否对android sdkAndroid Studio目录都有写访问权限.
  • 如果您使用的是Windows操作系统,请尝试通过右键单击Studio的图标以管理员身份运行Android Studio.

  • @aat你可以更广泛地解释一下你做了什么吗?我有同样的问题.我检查了分区权限,它们似乎没问题.通常我将写入权限设置为完整的项目目录,但它只是暂时的,然后经过一段时间再次重复. (4认同)
  • 伟大的@Youngjae,当我的贡献帮助某人时,它让我感觉很好. (2认同)

Ode*_*ner 5

如果您使用的是*UNIX,则可以从Android Studio命令行运行此命令

sudo chmod -R 777 /your/project/path
Run Code Online (Sandbox Code Playgroud)