久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

將字節碼轉換為 dex 時出錯:原因:java.lang.RuntimeE

Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes - Android studio 2.0 beta 6(將字節碼轉換為 dex 時出錯:原因:java.lang.RuntimeException:異常解析類 - Android Studio 2.0 beta 6) - I
本文介紹了將字節碼轉換為 dex 時出錯:原因:java.lang.RuntimeException:異常解析類 - Android Studio 2.0 beta 6的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我用 gradle 更新到了最新版本的 Android studio 2.0 Beta 6:

I updated to the last version of Android studio 2.0 Beta 6 with the gradle :

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-beta6'
}

該應用在我測試過的所有東西的模擬器和設備上運行良好.

The app works perfectly fine on emulator and devices I tested every thing and it works fine.

我只有在嘗試生成簽名的 APK 時遇到了很多錯誤,

I got many errors only when I try to Generate Signed APK,

我在依賴項中遇到了一些錯誤,當我排除矢量繪圖、矢量動畫繪圖和 Support-v4 庫時,所有這些錯誤都解決了

I got some errors in dependencies, all of them solved when i excluded vector drawable, vector animate drawable and Support-v4 library

現在我沒有任何依賴錯誤.

Now i dont have any dependencies error.

現在我的 app 模塊的 gradle.build 看起來像這樣:

now my gradle.build for the app module looks like this:

apply plugin: 'com.android.application'

android {
    configurations {
        //all*.exclude group: 'com.android.support', module: 'support-v4'
        all*.exclude module: 'animated-vector-drawable'
        all*.exclude module: 'support-vector-drawable'
        //all*.exclude module: 'support-v4'

    }
    repositories {
        maven { url "https://jitpack.io" }

    }
    compileSdkVersion 23
    buildToolsVersion '23.0.2'
    defaultConfig {
        applicationId "com.test.test"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1"

//        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile('com.github.afollestad.material-dialogs:commons:0.8.5.5@aar') {
        transitive = true
        exclude module: 'support-v4'
        exclude module: 'appcompat-v7'
        exclude module: 'recyclerview-v7'
    }
    compile('com.google.android.gms:play-services-ads:8.4.0') {
        exclude module: 'support-v4'
    }
    compile('com.google.android.gms:play-services-analytics:8.4.0') {
        exclude module: 'support-v4'
    }
    compile('com.android.support:appcompat-v7:23.2.0') {
        exclude module: 'support-v4'
        exclude module: 'animated-vector-drawable'
        exclude module: 'support-vector-drawable'
    }
    compile('com.android.support:support-v4:23.2.0') {
        exclude module: 'animated-vector-drawable'
        exclude module: 'support-vector-drawable'
    }
    compile('com.android.support:palette-v7:23.2.0') {
        exclude module: 'support-v4'
    }
    compile('com.android.support:cardview-v7:23.2.0') {
        exclude module: 'support-v4'
    }
    compile('com.android.support:recyclerview-v7:23.2.0') {
        exclude module: 'support-v4'
    }
    compile('com.android.support:design:23.2.0') {
        exclude module: 'support-v4'
    }
    compile('com.nineoldandroids:library:2.4.0') {
        exclude module: 'support-v4'
    }
    compile('com.baoyz.swipemenulistview:library:1.2.1') {
        exclude module: 'support-v4'
        exclude module: 'appcompat-v7'
        exclude module: 'recyclerview-v7'
    }
    compile('com.squareup.picasso:picasso:2.5.2') {
        exclude module: 'support-v4'
    }
    compile('com.nononsenseapps:filepicker:2.5.0') {
        exclude module: 'support-v4'
        exclude module: 'appcompat-v7'
        exclude module: 'recyclerview-v7'

    }
    compile 'com.google.code.gson:gson:2.6.1'
}

只有在我為發布而構建時才會出現錯誤:

The errors shows up only when I build for release:

這是我打開multiDex時的錯誤:

This is the error when i turn on multiDex:

Error:Execution failed for task ':app:transformClassesWithMultidexlistForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

這是我關閉它時的錯誤:

And this is the error when i turn it off:

:app:transformClassesWithDexForRelease
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes

Error:Execution failed for task ':app:transformClassesWithDexForRelease'.

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

我嘗試將 buildToolsVersion '23.0.2' 更改為所有可能的版本,但沒有任何改變.

I tried to change the buildToolsVersion '23.0.2' to every possible version and nothing changed.

當我輸入 22.0.1 版本時出現此錯誤:

when i put the version 22.0.1 i got this error:

Error:Error converting bytecode to dex:
Cause: com.android.dx.cf.iface.ParseException: name already added: string{"a"}

Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

我嘗試了所有可能的支持庫版本和相同的結果.

I tried with all possible support libraries version and same result.

我嘗試使用 Java 1.6 和 1.7,但沒有任何改變!

I tried with Java 1.6 and 1.7 and nothing has changed !

請問還有什么其他可能的解決方案?

what can be other possible solution please ?

推薦答案

我也遇到了同樣的錯誤,我正在搜索許多具有重復依賴項或 multidex 等的現有答案,但沒有一個有效.(Android studio 2.0 Beta 6,構建工具 23.0.2,無 multidex)

I also faced the same error, and i was searching through many existing answers with duplicate dependencies or multidex etc. but none worked. (Android studio 2.0 Beta 6, Build tools 23.0.2, no multidex)

原來我曾經使用的包名與清單中描述的包名不匹配.

It turned out that i once used a package names which didn't match the package name that is depicted in the Manifest.

在其他 ParseException 行中,我發現我在不同模塊中有文件,這些文件具有相似的包名稱/路徑,可能會與 dexer 發生沖突.

In other ParseException lines, i found out that i had files in different modules whith similiar package names/paths that possibly conflicted the dexer.

示例:

模塊 A:com.example.xyz.ticketing.modulea.Interface.java

模塊 B:com.example.Xyz.ticketing.moduleb.Enumerations.java

模塊 C:依賴于 A 和 B

Module C: Has dependencies on A and B

將Xyz"修復為小寫后,dexer 又正常了.

After fixing "Xyz" to lowercase, the dexer was fine again.

如何找出:

當我查看 gradle 控制臺的輸出時,ParseExceptions 看起來像這樣:

When i looked through the output of the gradle console for the ParseExceptions that looks like this:

AGPBI: {"kind":"error","text":"將字節碼轉換為 dex 時出錯: 原因:java.lang.RuntimeException: 異常解析類"

AGPBI: {"kind":"error","text":"Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes"

我滾動到接近異常的末尾.在那長長的異常行中有一部分實際上提到了原因:

I scrolled close to the end of the exception. There is a part in that long exception line that actually mentions the cause:

引起:com.android.dx.cf.iface.ParseException:類名(at/dummycompany/mFGM/hata/hwp/BuildConfig)與路徑不匹配(at/dummycompany/mfgm/hata/hwp/BuildConfig.class)

這樣我找到了在哪里搜索不匹配的包名稱/路徑

This way i found out where to search for missmatching package names/paths

這篇關于將字節碼轉換為 dex 時出錯:原因:java.lang.RuntimeException:異常解析類 - Android Studio 2.0 beta 6的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 网站国产| 久久久久黑人 | 丁香久久 | 国产电影一区二区三区爱妃记 | 国产精品免费在线 | 亚洲欧美日韩高清 | www.中文字幕.com | 久久久国产一区二区 | 91精品国产综合久久久动漫日韩 | 成人一区二区在线 | 亚洲国产精品一区二区久久 | 久久与欧美 | 亚洲国产成人精品女人久久久 | 久久精品亚洲 | 日韩精品一区二 | 日韩欧美中文字幕在线观看 | 欧美黄色片 | 国产aⅴ精品 | 亚洲高清在线 | 亚洲成人自拍网 | 国产精品久久久久久久久久免费看 | 日韩欧美一级片 | 亚洲一区二区在线 | 最新日韩在线视频 | 国产精品久久久久久久久免费丝袜 | 99精品一区二区 | 日韩欧美在线不卡 | 视频第一区 | 久久久久9999 | 国产精品久久久久久亚洲调教 | 国产剧情久久 | 人妖一区| 免费a级毛片在线播放 | 成人天堂| 国产一区二区三区视频在线观看 | 一区二区三区欧美大片 | 日本精品一区二区三区视频 | 日韩高清不卡 | 中文字幕乱码一区二区三区 | 九久久| 亚洲高清在线观看 |