android-studio - 在颤振应用程序中集成 srtipe 时出现 Gradle 异常
问题描述
我正在一个已经集成了 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'
构建.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 以查看工件的依赖路径。此错误消息来自 google-services Gradle 插件,在 https://github.com/google/play-services-plugins 报告问题并通过将“googleServices { disableVersionCheck = false }”添加到您的 build.gradle 文件来禁用。
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
BUILD FAILED in 2s Finished with error: Gradle task assembleDebug failed with exit code 1
发布规范.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
请帮我修复这个错误。
解决方案
我认为,在失败中没有什么取决于gradle
. pubspec
正如您在日志中看到的那样,所有这些依赖项都在您的文件中。
您可以尝试做的第一件事 - 在此处检查所有这些依赖项https://pub.dev/并将它们设置为最新版本。
如果这没有帮助 - 我不能给你 100% 的解决方案。当我遇到这样的问题时 - 我只是尝试降级冲突依赖的版本并尝试重建项目(您可以在同一站点https://pub.dev/看到所有以前的版本)。
实际上,我没有看到com.nimbusds:nimbus-jose-jwt
依赖关系pubspec
,所以它必须在gradle
文件中,而不是在你的文件中。您的某些pubspec
依赖项包含本机代码。
您可以通过查看 Android Studio 的左侧来探索您的依赖项 - 在树中External libraries
->Flutter plugins
推荐阅读
- javascript - 为什么 lengthPal 将 testPalindrone.length 存储为数字?
- xaml - 如何以 xamarin 形式以各种颜色显示日历特定日期
- oracle - Oracle Apex 19.2 如何更改登录页面上的应用程序图标颜色
- docker - Docker Inside Docker oom_score_adj:参数无效
- php - Yii2 保护资产和文件夹
- python-3.x - Gnuradio 可能的路径问题阻止使用 python 程序
- python - 在 python/django 中将变量从一种方法传递到另一种方法
- ruby-on-rails - Rails 的表单验证中未打印错误
- c# - 在 LINQ 中,一个 DbSet,一个表的实体集合如何指向另一个表
- html - 如何在 django 模板中制作水平产品列表视图