Android 任务';的执行失败:应用程序:选中ReleaseDuplicateClasses';。颤振
请查找以下文件 1.app/build.gradleAndroid 任务';的执行失败:应用程序:选中ReleaseDuplicateClasses';。颤振,android,firebase,flutter,dart,firebase-authentication,Android,Firebase,Flutter,Dart,Firebase Authentication,请查找以下文件 1.app/build.gradle def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.lo
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'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mood_reader_demo"
minSdkVersion 16
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.firebase:firebase-auth:19.3.0"
implementation 'com.google.android.gms:play-services-vision:20.0.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-bom:25.12.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "com.android.support:support-v4:27.1.1"
}
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2。android/build.gradle
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'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mood_reader_demo"
minSdkVersion 16
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.firebase:firebase-auth:19.3.0"
implementation 'com.google.android.gms:play-services-vision:20.0.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-bom:25.12.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "com.android.support:support-v4:27.1.1"
}
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
sdk:“>=2.7.0我在我的app/build.gradle中做了以下更改 除去
implementation 'com.google.android.gms:play-services-vision:20.0.0
implementation 'com.google.android.gms:play-services-vision:20.0.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.firebase:firebase-dynamic-links:19.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-bom:25.12.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "com.android.support:support-v4:27.1.1"
另外,需要匹配pubspec.yaml中的依赖项,使缓存失效并从ASDid重新启动。但仍然存在相同的问题请查看
com.google.android.gms:play services vision:20.0.0
和com.google.android.gms:play services vision:19.1.0
中清楚显示的错误。两者都是相同的,只是版本不同而已你最近更新了依赖项吗?是的。我已经更新了。但在执行了无效缓存并重新启动后,其行为仍然相同。我也看到了相同的错误,但无法找到19.1.0Doflatter clean
,如果没有帮助的话。转到yourAppFolder->android。
Open cmd dogradlew clean