2016-11-14 2 views
1

Я только что обновил мою Android-студию до последней версии 2.2.2. После этого нужно обновить gradle. Но после обновления обоих я не могу запустить свой проект, который ранее выполнялся очень Что ж.Проблема с установкой Studio Studio Gradle (не удалось запустить проект)

Ниже Gradle ошибка журнала: -

Warning:WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for productionDebug as it may be conflicting with the internal version provided by Android.

Warning:WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for productionRelease as it may be conflicting with the internal version provided by Android.

Warning:WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for stagingDebug as it may be conflicting with the internal version provided by Android.

Warning:WARNING: Dependency xpp3:xpp3:1.1.4c is ignored for stagingRelease as it may be conflicting with the internal version provided by Android.

Warning:Conflict with dependency 'com.android.support:recyclerview-v7'. Resolved versions for app (23.0.0) and test app (21.0.3) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Warning:Conflict with dependency 'com.android.support:support-v4'. Resolved versions for app (25.0.0) and test app (21.0.3) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Warning:Conflict with dependency 'com.android.support:recyclerview-v7'. Resolved versions for app (23.0.0) and test app (21.0.3) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Warning:Conflict with dependency 'com.android.support:support-v4'. Resolved versions for app (25.0.0) and test app (21.0.3) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Error:Execution failed for task ':app:prepareStagingDebugAndroidTestDependencies'.Dependency Error. See console for details.

И Heres Мой файл build.gradle для справки: -

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

apply plugin: 'com.google.gms.google-services' 

android { 
    useLibrary 'org.apache.http.legacy' 
    packagingOptions { 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'LICENSE.txt' 
    } 
    compileSdkVersion 23 
    buildToolsVersion '22.0.1' 
    defaultConfig { 
     multiDexEnabled true 
     applicationId 'com.qa.app' 
     minSdkVersion 15 
     targetSdkVersion 21 
     versionCode 28 
     versionName '3.5' 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 

    } 
    dexOptions { 
     incremental true 
     javaMaxHeapSize "2048M" 
     jumboMode = true 
    } 

    productFlavors { 
     production { 
      minSdkVersion 15 
      targetSdkVersion 21 
      versionCode 28 
      versionName '3.5' 
      signingConfig signingConfigs.config 
     } 
     staging { 
      minSdkVersion 15 
      targetSdkVersion 21 
      versionCode 28 
      versionName '3.5' 
      signingConfig signingConfigs.config 
     } 
    } 

    lintOptions { 
     abortOnError false 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:22.2.0' 
    compile 'com.android.support:support-v4:22.2.0' 
    compile 'com.android.support:cardview-v7:22.1.1' 
    compile 'com.android.support:recyclerview-v7:22.1.1' 
    compile 'com.android.support:design:22.2.1' 
    compile 'com.facebook.rebound:rebound:0.3.7' 
    compile 'com.google.code.gson:gson:2.3.1' 
    compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.2' 
    compile 'com.facebook.android:facebook-android-sdk:4.+' 
    compile 'com.facebook.android:notifications:1.0.2' 
// compile 'com.google.android.gms:play-services:7.5.0' 
    compile 'com.google.android.gms:play-services:9.6.1' 
    compile 'de.keyboardsurfer.android.widget:crouton:[email protected]' 
    compile 'com.loopj.android:android-async-http:1.4.6' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    compile 'com.android.support:support-annotations:25.0.0' 
    // compile 'com.google.android.gms:play-services:7.5.0' 
    compile project(':library') 
    androidTestCompile 'com.android.support:support-annotations:25.0.0' 
    // androidTestCompile 'com.android.support:support-annotations:22.2.1' 
    androidTestCompile 'com.android.support.test:runner:0.2' 
    androidTestCompile 'com.android.support.test:rules:0.2' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1' 
    androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.0' 
    compile project(':rate-me') 
    compile project(':volleyNew') 
    compile files('libs/YouTubeAndroidPlayerApi.jar') 
    compile('com.paypal.sdk:paypal-android-sdk:2.15.0') { 
     exclude group: 'io.card' 
    } 
    compile 'org.igniterealtime.smack:smack-android-extensions:4.1.0' 
    compile 'org.igniterealtime.smack:smack-experimental:4.1.0' 
    compile 'org.igniterealtime.smack:smack-tcp:4.1.0' 
    compile 'org.igniterealtime.smack:smack-im:4.1.0' 
    compile 'com.loopj.android:android-async-http:1.4.6' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.squareup.picasso:picasso:2.4.0' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
} 
+0

@ vishnumm93 это плохой совет. Вы должны * разрешить * конфликт версии, а не * избегать *. –

+0

@ Проверьте это решение http://stackoverflow.com/questions/31049735/can-not-run-application-below-lollipop – Raghavendra

ответ

2

В вашем случае решение должно быть, чтобы добавить следующую строку Зависимости:

androidTestCompile 'com.android.support:recyclerview-v7:25.0.0' 
androidTestCompile 'com.android.support:support-v4:25.0.0' 

Также вы должны выровнять версии библиотек поддержки. В вашем случае все они должны быть 25.0.0

Вот аналогичный вопрос: Resolved versions for app (22.0.0) and test app (21.0.3) differ

UPDATE: Для контроля зависимостей проще, вы можете определить переменную, в которой можно хранить текущую поддержку версии библиотек.

Таким образом, ваш блок зависимостей должен быть следующим:

def support_version = '25.0.0' 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile files('libs/YouTubeAndroidPlayerApi.jar') 

    // support libraries that should have the same version 
    compile "com.android.support:appcompat-v7:$support_version" 
    compile "com.android.support:cardview-v7:$support_version" 
    compile "com.android.support:support-v4:$support_version" 
    compile "com.android.support:recyclerview-v7:$support_version" 
    compile "com.android.support:support-annotations:$support_version" 
    compile "com.android.support:design:$support_version" 

    compile project(':library') 
    compile project(':rate-me') 
    compile project(':volleyNew') 

    compile 'com.facebook.rebound:rebound:0.3.7' 
    compile 'com.google.code.gson:gson:2.3.1' 
    compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.2' 
    compile 'com.facebook.android:facebook-android-sdk:4.+' 
    compile 'com.facebook.android:notifications:1.0.2' 
    compile 'com.google.android.gms:play-services:9.6.1' 
    compile 'de.keyboardsurfer.android.widget:crouton:[email protected]' 
    compile 'com.loopj.android:android-async-http:1.4.6' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    compile 'org.igniterealtime.smack:smack-android-extensions:4.1.0' 
    compile 'org.igniterealtime.smack:smack-experimental:4.1.0' 
    compile 'org.igniterealtime.smack:smack-tcp:4.1.0' 
    compile 'org.igniterealtime.smack:smack-im:4.1.0' 
    compile 'com.loopj.android:android-async-http:1.4.6' 
    compile 'com.android.support:multidex:1.0.0' 
    compile 'com.squareup.picasso:picasso:2.4.0' 

    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile('com.paypal.sdk:paypal-android-sdk:2.15.0') { 
     exclude group: 'io.card' 
    } 

    androidTestCompile "com.android.support:recyclerview-v7:$support_version" 
    androidTestCompile "com.android.support:support-v4:$support_version" 
    androidTestCompile "com.android.support:support-annotations:$support_version" 

    androidTestCompile 'com.android.support.test:runner:0.2' 
    androidTestCompile 'com.android.support.test:rules:0.2' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1' 
    androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.0' 
} 

Подробнее: GString, Resolving conflicts between main and test APK

+0

Я добавил выше двух строк, но результат такой же, как и выше. –

+1

Так что мне также нужно изменить версию поддержки до 25.0.0 –

+1

@ Когда я обновил ответ. После этого перестройте свой проект –

Смежные вопросы