【发布时间】:2019-09-12 13:55:02
【问题描述】:
我正在开发一个已经集成了 firebase 的颤振应用程序。
当我为条纹添加颤振包并运行应用程序时,我得到了 gradle 异常。
应用构建.gradle
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.lab.murtuza.qualvet"
minSdkVersion 19
targetSdkVersion 28
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation 'com.google.firebase:firebase-firestore:21.0.0'
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.firebase:firebase-storage:19.0.1'
implementation 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'
build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
FAILURE:构建失败并出现异常。
出了什么问题: 无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。 在项目“应用程序”中,已解决的 Google Play 服务库依赖项依赖于另一个确切版本(例如“[1.3.1 ,2.3]",但未解析为该版本。库表现出的行为将是未知的。
Dependency failing: com.nimbusds:nimbus-jose-jwt:7.7 -> net.minidev:json-smart@[1.3.1,2.3], but json-smart version was 2
.3.
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends on project 'stripe_payment' which depends onto com.stripe:stripe-android@10.3.1
-- Project 'app' depends onto net.minidev:json-smart@2.3
-- Project 'app' depends onto com.stripe:stripe-3ds2-android@1.2.1
-- Project 'app' depends onto com.nimbusds:nimbus-jose-jwt@7.7
-- Project 'app' depends onto com.stripe:stripe-android@10.3.1
对于扩展调试信息,使用 ./gradlew --info :app:assembleDebug 从命令行执行 Gradle 以查看 dep 工件的结束路径。此错误消息来自 google-services Gradle 插件,在 https:// 报告问题 github.com/google/play-services-plugins 并通过将“googleServices { disableVersionCheck = false }”添加到您的 b 来禁用 uild.gradle 文件。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在 2 秒内构建失败 完成错误:Gradle 任务 assembleDebug 失败,退出代码为 1
pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
countdown: ^0.1.0
stripe_payment: ^0.2.1
shared_preferences: ^0.5.3+4
google_maps_flutter: ^0.5.21
image: ^2.1.4
flutter_lorem: ^1.1.0
geoflutterfire: ^2.0.3+5
firebase_core: ^0.4.0+1
cloud_firestore: ^0.12.9+3
firebase_storage: ^3.0.6
firebase_auth: ^0.14.0+5
fluttertoast: ^3.1.3
location: ^2.3.5
flutter_spinkit: "^4.0.0"
image_picker: ^0.6.1+4
dev_dependencies:
flutter_test:
sdk: flutter
请帮我修复这个错误。
【问题讨论】:
-
请同时粘贴您的
pubspec.yaml依赖项 -
已添加,请查看
-
您对这个问题的最终解决方案是什么?我现在遇到了这个
标签: android-studio gradle flutter dart stripe-payments