2017-12-29 46 views
3

Ich erstelle eine Android App und ich muss ziehen und verschieben. Deshalb habe ich eine Bibliothek namens "Advanced RecyclerView" gefunden.Wie behebt man dieses Gradle Build Problem?

Also habe ich versucht, die obige Bibliothek mit Gradle für Android hinzuzufügen.

Die Linien sind: Build

dependencies { 
    implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
} 

Meine Ausgabe

Nach Zugabe dieser Zeilen, die ich auf Gradle folgende Fehlermeldung anzeigt:

Error:Could not find com.android.support:recyclerview-v7:27.0.0. Required by: Nuvo_Rider:app:unspecified Nuvo_Rider:app:unspecified > com.l4digital.fastscroll:fastscroll:1.0.4 Nuvo_Rider:app:unspecified > com.android.support:design:25.3.1

Please install the Android Support Repository from the Android SDK Manager. Open Android SDK Manager

Meine Schritte ich zu lösen versucht, compileSDKversion auf 27 zu ändern und auch re cyclerview.V27.0.2, konnte aber keine Lösung finden.

Mein Gradle:

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

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

apply plugin: 'com.neenbedankt.android-apt' 
def AAVersion = '4.2.0' 
def AndroidSupportVersion = '25.3.1' 

buildscript { 
    repositories { 
     jcenter() 
     mavenCentral() 
     mavenLocal() 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
     classpath 'io.fabric.tools:gradle:1.21.6' 
    } 
} 

android { 
// compileSdkVersion 25 
// buildToolsVersion "25.0.2" 
    compileSdkVersion 24 
    buildToolsVersion "25.0.1" 

    defaultConfig { 
     applicationId "com.nuvo.rider" 
     minSdkVersion 19 
     targetSdkVersion 25 
     //versionCode 6 
     //versionName "1.2.3" 
     versionCode 11 
     versionName "1.0" 
     // Enabling multidex support. 
     multiDexEnabled true 
     // vector appCompact 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    useLibrary 'org.apache.http.legacy' 
} 

apt { 
    arguments { 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //Default 
    //noinspection GradleCompatible 
    //compile "com.android.support:appcompat-v7:$AndroidSupportVersion" 
    // compile "com.android.support:design:$AndroidSupportVersion" 
    compile "com.android.support:support-annotations:$AndroidSupportVersion" 
    //Card View 
    compile "com.android.support:cardview-v7:$AndroidSupportVersion" 
    //Recyleerview 
    compile "com.android.support:recyclerview-v7:$AndroidSupportVersion" 
    //Annotation 
    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 

    //Stripe 
    compile('com.stripe:stripe-android:[email protected]') { 
     transitive = true; 
    } 
    //Fabric 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 

    //Crashlytics 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 

    compile('com.crashlytics.sdk.android:crashlytics-ndk:[email protected]') { 
     transitive = true; 
    } 

    //Scan Card 
    //Multidex 
    //Validator 
    //EditText 
    //Facebook SDK 
    //Firebase & GeoFire 
    //glide 

    //Route Drawer 
    //Top Snackbar 
    //Universal Image Loader 

    //Stripe 
    compile('com.stripe:stripe-android:[email protected]') { 
     transitive = true; 
    } 
    //Fabric 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 

    //Crashlytics 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 

    //Volley 

    compile('com.l4digital.fastscroll:fastscroll:1.0.4') { 
     transitive = true; 
    } 
    compile('io.reactivex.rxjava2:rxandroid:2.0.1') { 
     transitive = true; 
     // exclude group: 'universal-image-loader-1.9.5.jar'; 
    } 

    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.android.support:design:24.2.1' 
    compile 'com.google.android.gms:play-services:10.2.0' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.mobsandgeeks:android-saripaar:2.0.2' 
    compile 'com.rengwuxian.materialedittext:library:2.1.4' 
    compile 'com.facebook.android:facebook-android-sdk:4.1.2' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'com.firebase:geofire-android:2.1.1' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'com.jaredrummler:material-spinner:1.1.0' 
    compile 'com.akexorcist:googledirectionlibrary:1.0.5' 
    compile 'com.androidadvance:topsnackbar:1.1.1' 
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 
    compile 'cn.pedant.sweetalert:library:1.3' 
    compile 'com.mcxiaoke.volley:library:1.0.19' 
    compile 'com.squareup.okhttp3:okhttp:3.6.0' 
    compile 'io.card:android-sdk:5.5.0' 
    compile 'com.wdullaer:materialdatetimepicker:3.1.2' 
    compile 'com.googlecode.libphonenumber:libphonenumber:8.7.0' 
    compile 'com.android.support:support-v4:25.3.0' 
    compile 'com.kyleduo.switchbutton:library:1.4.6' 
    compile 'com.cocosw:bottomsheet:[email protected]' 
    compile 'com.squareup.retrofit2:retrofit:2.3.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.3.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'net.authorize:accept-sdk-android:1.0.2' 

} 

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

crashlytics { 
    enableNdk true 
    androidNdkOut 'src/main/obj' 
    androidNdkLibsOut 'src/main/libs' 
} 

Final Words

Da ich auf Android neu bin, kann ich nicht dieses Problem beheben.

+1

In diesem Fall ist es immer eine gute Idee, die von der Bibliothek zur Verfügung gestellte Beispiel-App zu verwenden und Ihre App darüber zu bauen. Probleme mit der Version beheben sind wirklich frustrierend. Später, wenn Sie möchten, können Sie Ihre Versionen mit aktualisieren. – Muhammad

+0

@Muhammad .. Ja. Eine gute Idee. Aber da meine App riesig ist, ist es schwierig, eine andere App zu integrieren .. !! –

Antwort

0

gleichen Einsatz Versionen überprüfen unter

 apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

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

apply plugin: 'com.neenbedankt.android-apt' 
def AAVersion = '4.2.0' 
def AndroidSupportVersion = '24.2.1' //change here 

buildscript { 
    repositories { 
     jcenter() 
     mavenCentral() 
     mavenLocal() 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
     classpath 'io.fabric.tools:gradle:1.21.6' 
    } 
} 

android { 
// compileSdkVersion 25 
// buildToolsVersion "25.0.2" 
    compileSdkVersion 24 
    buildToolsVersion "25.0.1" 

    defaultConfig { 
     applicationId "com.nuvo.rider" 
     minSdkVersion 19 
     targetSdkVersion 25 
     //versionCode 6 
     //versionName "1.2.3" 
     versionCode 11 
     versionName "1.0" 
     // Enabling multidex support. 
     multiDexEnabled true 
     // vector appCompact 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    useLibrary 'org.apache.http.legacy' 
} 

apt { 
    arguments { 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    //Default 
    //noinspection GradleCompatible 
    //compile "com.android.support:appcompat-v7:$AndroidSupportVersion" 
    // compile "com.android.support:design:$AndroidSupportVersion" 
    compile "com.android.support:support-annotations:$AndroidSupportVersion" 
    //Card View 
    compile "com.android.support:cardview-v7:$AndroidSupportVersion" 
    //Recyleerview 
    compile "com.android.support:recyclerview-v7:$AndroidSupportVersion" 
    //Annotation 
    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 

    //Stripe 
    compile('com.stripe:stripe-android:[email protected]') { 
     transitive = true; 
    } 
    //Fabric 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 

    //Crashlytics 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 

    compile('com.crashlytics.sdk.android:crashlytics-ndk:[email protected]') { 
     transitive = true; 
    } 

    //Scan Card 
    //Multidex 
    //Validator 
    //EditText 
    //Facebook SDK 
    //Firebase & GeoFire 
    //glide 

    //Route Drawer 
    //Top Snackbar 
    //Universal Image Loader 

    //Stripe 
    compile('com.stripe:stripe-android:[email protected]') { 
     transitive = true; 
    } 
    //Fabric 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 

    //Crashlytics 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 

    //Volley 

    compile('com.l4digital.fastscroll:fastscroll:1.0.4') { 
     transitive = true; 
    } 
    compile('io.reactivex.rxjava2:rxandroid:2.0.1') { 
     transitive = true; 
     // exclude group: 'universal-image-loader-1.9.5.jar'; 
    } 

    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.android.support:design:24.2.1' 
    compile 'com.google.android.gms:play-services:10.2.0' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.mobsandgeeks:android-saripaar:2.0.2' 
    compile 'com.rengwuxian.materialedittext:library:2.1.4' 
    compile 'com.facebook.android:facebook-android-sdk:4.1.2' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'com.firebase:geofire-android:2.1.1' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'com.jaredrummler:material-spinner:1.1.0' 
    compile 'com.akexorcist:googledirectionlibrary:1.0.5' 
    compile 'com.androidadvance:topsnackbar:1.1.1' 
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 
    compile 'cn.pedant.sweetalert:library:1.3' 
    compile 'com.mcxiaoke.volley:library:1.0.19' 
    compile 'com.squareup.okhttp3:okhttp:3.6.0' 
    compile 'io.card:android-sdk:5.5.0' 
    compile 'com.wdullaer:materialdatetimepicker:3.1.2' 
    compile 'com.googlecode.libphonenumber:libphonenumber:8.7.0' 
    compile 'com.android.support:support-v4:24.2.1' //change here 
    compile 'com.kyleduo.switchbutton:library:1.4.6' 
    compile 'com.cocosw:bottomsheet:[email protected]' 
    compile 'com.squareup.retrofit2:retrofit:2.3.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.3.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'net.authorize:accept-sdk-android:1.0.2' 

} 

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

crashlytics { 
    enableNdk true 
    androidNdkOut 'src/main/obj' 
    androidNdkLibsOut 'src/main/libs' 
} 
+0

Keine Lösung. Gleiches Problem mit derselben oben erwähnten Fehlermeldung !!!!! @Omi –

1

FOLLOW THE

Schritte, um die folgenden Codezeilen in Ihre build.gradle hinzufügen.

Schritt 1:

dependencies { 
    implementation ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
} 

HINWEIS: Diese Bibliothek auf jCenter serviert. Wenn die obige Einstellung nicht funktioniert, versuchen Sie, die folgenden Zeilen hinzuzufügen.

Schritt 2:

repositories { 
    jcenter() 
} 

ATTENTION: Make sure you Global Gradle Setting wasn't offline

Check it,

File > Setting > Build,Execution,Deployment > Gradle

Wenn offline work Kontrollkästchen aktiviert ist, dann bitte deaktivieren.

enter image description here Versuchen Sie zu Clean und Rebuild Projekt.

+0

Keine Lösung .. Das gleiche Problem wieder auftreten –

+1

Stellen Sie sicher, dass Ihr jCenter() in Projektebene build.gradle –

+0

ja definiert ist. habe es schon hinzugefügt –

Verwandte Themen