提问人:Bani Akram 提问时间:11/7/2023 最后编辑:Bani Akram 更新时间:11/10/2023 访问量:571
com.google.android.gms:play-services-maps 已报告版本 16.0.0 已过时
com.google.android.gms:play-services-maps has reported version 16.0.0 as outdated
问:
我们有一个电子商务 Flutter 应用程序,它使用flutter_braintree包进行支付网关(PayPal、信用卡等)。
自从dev / devs更新软件包的任何内容以来已经过去了几个月。 今天,当我们尝试在PlayStore上发布更新时,它发出了警告,
The developer of Maps SDK for Android (com.google.android.gms:play-services-maps) has reported version 16.0.0 as outdated. After 90 days from releasing this version of your app, you won't be able to release new versions which contain this SDK until you upgrade to a newer version (17.0.0+).
具有此依赖关系的包原来是flutter_braintree。
现在,问题是,我对 android 开发一无所知,因为我只使用 Flutter。
我现在该怎么办?因为 3 个月后 PlayStore 不允许我发布更新。
我也在包的存储库中问过这个问题。 但我认为我不会很快得到任何回应。
如果有人需要查看它,我已经附上了颤动医生的回应。
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.6.8 21G725 darwin-x64, locale en-PK)
• Flutter version 2.10.4 at /Users/macbookpro/src/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (1 year, 7 months ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/macbookpro/Library/Android/sdk
• Platform android-34, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.10.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
这是android/build.gradle文件(我们的应用程序,而不是braintree)
buildscript {
ext.kotlin_version= "1.5.31"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
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
}
这是 braintree 软件包的 android/build.gradle 文件,
group 'com.example.flutter_braintree'
version '1.0'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
rootProject.allprojects {
repositories {
google()
jcenter()
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree'
password 'abc'
}
}
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.braintreepayments.api:drop-in:5.2.1'
implementation 'com.google.android.gms:play-services-wallet:16.0.1'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
components.all {
allVariants {
withDependencies { deps ->
deps.each { dep ->
if (dep.group == 'net.minidev' && dep.name =='json-smart') {
dep.version {
prefer "2.3"
}
dep.because "resolving dependencies issue"
}
}
}
}
}
}
整个项目中有 2 个名为 ivy.xml 的文件。可以在flutter_braintree(包)项目目录中的 flutter_braintree_master/android/build 文件夹中找到一个,在那里我可以看到以下行:
<dependency org="com.google.android.gms" name="play-services-maps" rev="16.0.0" transitive="false" conf="releaseCompileClasspath->default"/>
另一个可以在 main_project/ios/.symlinks/plugins/flutter_braintree/android/ivy.xml 的 android/build 文件夹中找到,在那里我可以看到类似的行,
<dependency org="com.google.android.gms" name="play-services-maps" rev="16.0.0" transitive="false" conf="releaseCompileClasspath->default"/>
这可能是导致问题的原因吗?
答:
有同样的问题。查找依赖关系并不总是那么简单,至少在 flutter 应用程序中是这样。若要查找使用依赖项的应用,请执行以下操作:
- 进入 FlutterAPP/android 目录
- 运行:gradlew app:dependencies
- 找出哪个在输出中使用了 dependecny
- 将软件包更新到更高版本。
如果软件包没有更新的版本,请尝试手动修复它:
转到 Flutter Pub 文件夹,然后搜索 Cache\hosted\pub.dev\LIBNAME\android\build.gradle 文件。
修复依赖项中的版本。重新生成应用程序。 测试。 更新。
评论