- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嗨,我是 android 和 Flutter 的新手,我在 1 小时前遇到了这个错误,我不明白如何解决它,有人可以帮我吗?先感谢您。
这是安卓文件。
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.ipill"
minSdkVersion 25
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
第二个文件:BuildGradle
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}
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
}
这是我得到的错误,我试图修复它,但我无法理解该怎么做,因为我无法在线找到解决方案。
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.android.gms.location.places.zza found in modules jetified-play-services-places-12.0.1-runtime.jar (com.google.android.gms:play-services-places:12.0.1) and jetified-play-services-places-placereport-17.0.0-runtime.jar (com.google.android.gms:play-services-places-placereport:17.0.0)
Duplicate class com.google.android.gms.measurement.AppMeasurement found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$ConditionalUserProperty found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$Event found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$EventInterceptor found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$OnEventListener found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$Param found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.android.gms.measurement.AppMeasurement$UserProperty found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-impl-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-impl:17.4.1)
Duplicate class com.google.firebase.analytics.FirebaseAnalytics found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-api-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-api:17.4.1)
Duplicate class com.google.firebase.analytics.FirebaseAnalytics$Event found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-api-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-api:17.4.1)
Duplicate class com.google.firebase.analytics.FirebaseAnalytics$Param found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-api-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-api:17.4.1)
Duplicate class com.google.firebase.analytics.FirebaseAnalytics$UserProperty found in modules jetified-firebase-analytics-impl-12.0.1-runtime.jar (com.google.firebase:firebase-analytics-impl:12.0.1) and jetified-play-services-measurement-api-17.4.1-runtime.jar (com.google.android.gms:play-services-measurement-api:17.4.1)
这是包
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
firebase_core: ^0.5.0
firebase_auth: ^0.18.0+1
cloud_firestore: ^0.14.0+2
google_sign_in: ^4.5.3
google_maps_flutter: ^0.5.27+3
http: ^0.12.0+1
json_serializable: ^3.3.0
geolocator: ^6.0.0
google_place: ^0.3.3
dev_dependencies:
pedantic: ^1.9.0
build_runner: ^1.10.0
flutter_test:
sdk: flutter
最佳答案
在第一个代码中,删除以下内容。
dependencies {
implementation 'com.android.support:multidex:1.0.3' //remove
implementation 'com.google.android.gms:play-services:12.0.1' //remove
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
然后运行
flutter clean
不需要 Multidex,因为
minSdkVersion
高于 21。我知道 firebase 配置声明添加播放服务,但这不是必需的。
关于android - 重复类 com.google.android.gms.location.places.zza,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63962968/
该应用程序运行良好,但在 LeakCanary 中,每次关闭或暂停应用程序时都会出现泄漏。 我也尝试删除 authListener 但泄漏仍然存在。 我试图以多种不同的方式解决,但没有成功,有人可以帮
这是我的 build.gradle 应用文件: dependencies { //picture library compile 'com.github.bumptech.glide:
在我的 build.gradle 中,我使用了这个: android { compileSdkVersion 23 .... .... defaultConfig {
package com.example.qpay.currentlocation; import android.Manifest; import android.app.AlertDialog; i
我正在尝试运行我的应用程序,但是在尝试运行我的应用程序时出现错误。 构建.gradle: dependencies { implementation fileTree(dir: 'libs', inc
嗨,我是 android 和 Flutter 的新手,我在 1 小时前遇到了这个错误,我不明白如何解决它,有人可以帮我吗?先感谢您。 这是安卓文件。 def localProperties = new
这些是我在 list 文件中的依赖项 implementation fileTree(dir: 'libs', include: ['*.jar']) implementation '
我目前在运行我的项目时遇到了一些问题。 duplicate entry: com/google/android/gms/internal/zzai$zza.class 错误是说我有一个重复的依赖项,但
此错误仅在 minifyEnabled true 时出现,因此我怀疑问题与 proguard 或 R8 有关” 错误 2019-08-22 18:26:05.320 8403-8403/com.xxx
首先:让我解释一下情况,我有一个 sdk 与 google Api 一起使用并实现了很多依赖项。然后我将 lib 实现到我的新应用程序中,它也实现了依赖项。一切顺利,直到我尝试运行该应用程序。 当我(
我一直在关注本教程 implementing google maps android sdk并达到标题中提到的错误。本问题末尾提供崩溃详细信息。我一直在关注很多 SO 线程,但没有结果。到目前为止,一
我已经遇到这个问题两天了,仍然没有找到任何解决方案。我尝试更改库的版本、清理和构建项目以及使缓存无效等。 下面是我的 build.gradle 文件: apply plugin: 'com.andro
构建项目并将应用程序部署到 API 级别 22 或 25 的模拟器没问题,但是当我尝试构建 APK 或将应用程序部署到 API 级别 16 的真实设备时,我收到以下错误: Error:Executio
我正在运行仪器测试并收到此编译错误: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:tran
嗨,我正在尝试构建APK,但iam在Android Studio中面临此问题。 Error:Execution failed for task ':app:transformClassesWithJa
我已经将 Android Studio 更新到 3.4 和 Admob 库complie 'com.google.android.gms:play-services-ads:12.0.1' 到实现 '
我正在尝试在我的应用程序中实现 Firebase 云消息传递 (FCM)。我在 Build.gradle 中添加了以下依赖项并尝试构建发布构建变体。 compile 'com.google.fireb
错误: java.lang.NoSuchMethodError: No direct method (Landroid/content/Context;)V in class Lcom/google/
找不到从方法 com.google.android.gms.common.GooglePlayServicesUtil.zza 引用的类“android.app.AppOpsManager” 授权失败
当我尝试在 API 级别 22 之前的手机上运行该应用程序时,我收到此错误并且程序崩溃。但是该应用程序在 API 级别 22 的手机上运行正常。这可能是什么原因。 这是我的依赖: dependenci
我是一名优秀的程序员,十分优秀!