遇到Android开发问题

时间:2015-01-30 06:45:09

标签: android android-studio

请参阅以下附加屏幕截图。我将尝试添加android-v4 jar文件但在android stdio中遇到问题(在Android stdio中,通过导入项目功能添加)

enter image description here

导入jar文件时出现以下错误。

enter image description here

build.gradle(Module :: App)文件在这里

android {
    compileSdkVersion 13
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.jigsaw.startup"
        minSdkVersion 10
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    //    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.android.support:support-v4:21.0.3'alert    
}


configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'

如果有人需要任何额外信息,请告诉我。

2 个答案:

答案 0 :(得分:0)

构建脚本中的此语句:

configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
}

明确地将com.android.support.v4中的任何内容排除在链接到您的项目之外,这就是为什么import com.android.support.v4.Fragment语句不起作用的原因。删除它,导入应该没问题。

答案 1 :(得分:0)

我更改了Android API并在Android 4.2上工作。然后问题解决了。

感谢所有