我试图将Stripe sdk添加到我的Android项目中,然后开始出现此错误
失败:构建失败,并出现异常。
- 出了什么问题:在执行期间无法捕获任务':MyApp:checkDebugClasspath'属性'compileClasspath'的输入文件的快照 最新检查。
在“ MyApp”项目中,已解决的Google Play服务库依赖项依赖于另一个版本(例如“ [1。 3.1,2.3]“,但尚未解决该版本。该库显示的行为将是未知的。 依赖项失败:com.nimbusds:nimbus-jose-jwt:7.2.1-> net.minidev:json-smart @ [1.3.1,2.3],但是json-smart版本是 2.3。 以下依赖关系是直接的或具有传递性依赖关系的项目依赖关系,这些依赖关系导致了ifact 与问题。 -项目“ MyApp”取决于 com.stripe:stripe-android@9.3.5 有关扩展的调试信息,请从命令行使用./gradlew --info:MyApp:assembleDebug执行Gradle以查看依赖关系 工件的路径。此错误消息来自 google-services Gradle插件,在https
报告问题 ://github.com/google/play-services-plugins并通过添加进行禁用 向您发送“ googleServices {disableVersionCheck = false}” build.gradle文件。
我无法理解如何解决此问题,特别是因为除非绝对必要,否则我们不允许在支持库版本中进行更改。我尝试将google play库更新为最新版本,但仍然收到错误。这些是我的gradle依赖项。
dependencies {
implementation project(':ratemyapp')
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.mcxiaoke.volley:library:1.0.18'
implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/gcm.jar')
// Facebook SDK Core only (Analytics)
implementation 'com.facebook.android:facebook-core:4.33.0'
// Facebook Login only
implementation 'com.facebook.android:facebook-login:4.33.0'
implementation 'com.braintreepayments.api:braintree:2.14.2'
implementation 'com.braintreepayments.api:drop-in:3.4.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
/**
* Google
*/
implementation 'com.google.android.gms:strict-version-matcher-plugin:1.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.1.0'
implementation 'com.google.android.gms:play-services-nearby:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.google.android:flexbox:0.3.2'
//compile files('libs/splunk-mint-4.2.1.jar')
implementation 'com.android.support:design:27.1.1'
// CardView
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.pixplicity.multiviewpager:library:1.0'
implementation 'com.github.aakira:expandable-layout:1.4.1@aar'
implementation 'me.everything:overscroll-decor-android:1.0.4'
implementation 'org.apache.httpcomponents:httpmime:4.5.2'
implementation 'commons-net:commons-net:3.3'
implementation 'com.android.support:percent:27.1.1'
/*For Request Server*/
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
implementation 'com.artemzin.rxjava:proguard-rules:1.1.6.0'
/**
* Animation.
*/
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.easing:library:1.0.1@aar'
implementation 'com.daimajia.androidanimations:library:1.1.3@aar'
implementation 'net.soulwolf.widget:ratiolayout:1.0.0'
implementation 'com.jakewharton:butterknife:8.5.1'
kapt 'com.jakewharton:butterknife-compiler:8.5.1'
/**
* Event Bus.
*/
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.wefika:flowlayout:0.4.1'
/**
* Ring capcha
*/
implementation 'com.thrivecom:ringcaptcha:1.0.11@aar'
/**
* Zendesk
*/
implementation 'com.zopim.android:sdk:1.3.7.1'
implementation 'com.zendesk:support:2.0.0'
implementation('com.twitter.sdk.android:twitter:3.3.0@aar') {
transitive = true
}
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
transitive = true
}
implementation('io.fabric.sdk.android:fabric:1.3.12@aar') {
transitive = true
}
implementation 'io.branch.sdk.android:library:3.2.0'
implementation 'com.mixpanel.android:mixpanel-android:5.+'
implementation 'com.yqritc:android-scalablevideoview:1.0.4'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.google.dagger:dagger:2.12'
kapt 'com.google.dagger:dagger-compiler:2.11'
implementation 'com.google.dagger:dagger-android-support:2.11'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
kapt 'com.google.dagger:dagger-android-processor:2.11'
// ViewModel and LiveData
implementation 'android.arch.lifecycle:extensions:1.1.1'
kapt "android.arch.lifecycle:compiler:1.1.1"
// Room
implementation 'android.arch.persistence.room:runtime:1.1.1'
kapt "android.arch.persistence.room:compiler:1.1.1"
// Paging
implementation 'android.arch.paging:runtime:1.0.1'
implementation 'com.jakewharton.timber:timber:4.6.0'
// Test helpers for LiveData
testImplementation 'android.arch.core:core-testing:1.1.1'
// Test helpers for Room
testImplementation 'android.arch.persistence.room:testing:1.1.1'
implementation 'org.apache.commons:commons-lang3:3.6'
implementation 'com.github.bumptech.glide:glide:4.5.0'
kapt 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.github.rubensousa:gravitysnaphelper:1.5'
implementation 'me.everything:overscroll-decor-android:1.0.4'
implementation 'com.github.bumptech.glide:recyclerview-integration:4.4.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'android.arch.persistence.room:runtime:1.1.1'
implementation 'android.arch.persistence.room:rxjava2:1.1.1'
implementation 'android.arch.lifecycle:reactivestreams:1.1.1'
implementation 'com.github.zcweng:switch-button:0.0.3@aar'
implementation 'com.shuhart.bubblepagerindicator:bubblepagerindicator:1.0.6'
implementation 'com.iarcuschin:simpleratingbar:0.1.5'
implementation 'co.omise:omise-android:2.6.4'
implementation 'com.airbnb.android:lottie:2.5.4'
implementation 'com.adjust.sdk:adjust-android:4.13.0'
implementation 'com.android.installreferrer:installreferrer:1.0'
implementation 'io.card:android-sdk:5.5.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
androidTestImplementation 'org.mockito:mockito-core:2.7.19'
androidTestImplementation 'org.mockito:mockito-android:2.7.19'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation project(':menu')
implementation project(':base')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-perf:16.2.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-analytics:16.0.4'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.android.instantapps:instantapps:1.1.0'
implementation 'com.romandanylyk:pageindicatorview:1.0.2'
implementation 'com.airbnb.android:lottie:2.5.4'
implementation 'me.grantland:autofittextview:0.2.+'
//OTP
implementation 'com.poovam:pin-edittext-field:1.1.2'
implementation 'jp.wasabeef:glide-transformations:4.0.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.braintreepayments.api:data-collector:2.22.0'
//Applozic
implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.33'
//Places SDK
implementation ('com.google.android.libraries.places:places:1.1.0'){
exclude group: 'com.android.volley'
}
//Freshchat SDK
implementation 'com.github.freshdesk:freshchat-android:2.6.0'
//Freshdesk font
implementation 'uk.co.chrisjenx:calligraphy:2.1.0'
//Stripe
implementation 'com.stripe:stripe-android:9.3.5'
}
感谢您的任何建议或帮助,谢谢!
答案 0 :(得分:1)
这不是您的Play商店依赖项之一。您的错误消息显然是指责Stripe Payments库。该库具有对特定播放服务版本的内部引用。最有可能的解决方案是您的游戏服务太新了。我至少可以检查他们的下载站点是否有新版本。对于程序员来说,这是一个很普遍的问题,他们忘记了他们正在执行的版本检查应允许使用较新的版本,有时它是故意迫使您在不兼容的情况下进行更新。
答案 1 :(得分:1)
我解决了此问题,将Android Gradle插件更新为3.4.1,将Gradle更新为5.1.1,如果使用Kotlin,则更新为1.3.10。并且不要忘记将此添加到gradle中:
apply plugin: 'com.google.gms.google-services'
对于Stripe,我使用implementation 'com.stripe:stripe-android:9.3.5'
,并且不得不更改代码中的某些功能,例如:
Card card = new Card(...)
至Card card = Card.create(...)
和token.getCard().getType()
至token.getCard().getBrand()