简体   繁体   English

D8:程序类型已经存在:com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

[英]D8: Program type already present: com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

I am getting the following errors in my flutter project and getting no clue how to resolve it error:我在我的 flutter 项目中收到以下错误并且不知道如何解决它错误:

D8: Program type already present: com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
  Error while merging dex archives: 
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

build.gradle 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'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.tajicEasy"
        minSdkVersion 18
        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:2.0.1'
}
apply plugin: 'com.google.gms.google-services'

I have tried upgrading everything.我已经尝试升级所有内容。 also have tried solving it through existing available related answers but nothing worked for me.也尝试通过现有的可用相关答案解决它,但对我没有任何帮助。 also checked that there are no two classes for protobuf.还检查了 protobuf 没有两个类。 tried deleting build, .gradle files尝试删除构建,.gradle 文件

ok so I resolved this issue if anyone is facing the same then you have to check the following好的,如果有人遇到同样的问题,我解决了这个问题,那么您必须检查以下内容

  1. All the dependencies are updated所有依赖项都已更新
  2. multiDexEnabled true

if above doesn't solve the issues then check if any dependency is repeated if you can't find any repeated dependency then try removing the dependencies one by one then run the application again it will take time but your application will run once the error causing dependency is removed如果上面没有解决问题然后检查是否有重复的依赖如果你找不到任何重复的依赖然后尝试一个一个删除依赖然后再次运行应用程序这将需要一些时间但是一旦导致错误你的应用程序就会运行依赖被移除

Thanks, Hope that it is useful谢谢,希望有用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 构建失败,D8:程序类型已经存在 - Flutter build failed with D8: Program type already present D8:程序类型已经存在:android.support.v4.media.MediaBrowserCompat$CustomActionCallback - D8: Program type already present: android.support.v4.media.MediaBrowserCompat$CustomActionCallback Flutter build with CI 获取错误程序类型已经存在:com.google.common.util.concurrent.ListenableFuture - Flutter build with CI getting error Program type already present: com.google.common.util.concurrent.ListenableFuture 编译应用程序时,R8 程序类型已存在错误 - Error in R8 Program type already present, when compiling the app Geolocator插件问题:程序类型已存在:android.support.v4.app.INotificationSideChannel - Geolocator plugin issue: Program type already present: android.support.v4.app.INotificationSideChannel D8:无法在单个 dex 文件中容纳请求的类 - D8: Cannot fit requested classes in a single dex file Flutter Firestore 导致 D8:无法在 Android Studio 中将请求的类放入单个 dex 文件(#方法:71610 > 65536) - Flutter Firestore causing D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536) in Android Studio 在扑扑的谷歌地图中显示图像 - Present image in google maps in flutter > 在 org.gradle.api.Project - > Could not find method apply() for arguments [com.google.gms.google-services] on project ':app' of type org.gradle.api.Project 读取超时错误 builder.jar (com.android.tools.build:builder:3.2.1) - Flutter - Android Studio - Read timed out Error builder.jar (com.android.tools.build:builder:3.2.1) - Flutter - Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM