Error:Error converting bytecode viewer使用to dex: Cause: com.android.dex.DexException: Multiple dex files

java - Error converting bytecode to dex - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
I am pretty new to Android. When I build my current project I got this error:
Error:Error converting bytecode to dex: Cause:
com.android.dex.DexException: Multiple dex files define
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionI
This is my dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:recyclerview-v7:23.+'
compile 'com.android.support:support-v4:23.+'
compile 'com.google.code.gson:gson:2.5'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v4:+'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.kyleduo.switchbutton:library:1.4.0'
compile files('libs/JTransforms-3.1-with-dependencies.jar')
compile 'com.github.Semantive:waveform-android:v1.2'
compile files('libs/TarsosDSP-Android-latest.jar')
I'm using gradle 2.13 and gradle-build 2.1.
There were someone tell me to clean the project but it didn't work. Please help.
Well if i understand you question i hope this answer can help you.
You can increase the memory size that the dexer process is allowed to use.
Open the ini file that is located in:
C:\Users\\AppData\Roaming\Anywhere Software\Basic4android
Change this line:.
MaxRamForDex=1024 To:.
MaxRamForDex=1536
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled君,已阅读到文档的结尾了呢~~
dexpler converting android dalvik bytecode to jimple for:dexpler android dalvik字节码转换为以jimple
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
dexpler converting android dalvik bytecode to jimple for:dexpler android dalvik字节码转换为以jimple
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer--144.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Error:Error&converting&bytecode&to&dex:
Cause:&com.android.dex.DexException:&Multiple&dex&files&define&Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionI:app:transformClassesWithDexForRelease&FAILED
Error:Execution&failed&for&task&':app:transformClassesWithDexForRelease'.
&&com.android.build.api.transform.TransformException:&com.mon.process.ProcessException:&java.util.concurrent.ExecutionException:&com.mon.process.ProcessException:&org.gradle.process.internal.ExecException:&Process&'command&'E:\Dev\JDK\jdk1.8.0_77\bin\java.exe''&finished&with&non-zero&exit&value&2
Error:Error&converting&bytecode&to&dex:
Cause:&com.android.dex.DexException:&Multiple&dex&files&define&Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionI
第一次用as,请问这个怎么解决?
回复讨论(解决方案)
清理项目,紫薯布丁。
看看导入的jar是否有相同的
清理项目,紫薯布丁。
清理了没用
看看导入的jar是否有相同的
未找到相同的jar啊Java Code Example com.android.dex.Dex
Java Code Examples for com.android.dex.Dex
The following are top voted examples for showing how to use
com.android.dex.Dex. These examples are extracted from open source projects.
You can vote up the examples you like and your votes will be used in our system to product
more good examples.
+ Save this class to your library
Dex getDex() {
Dex result =
if (result == null) {
synchronized (this) {
if (result == null) {
dex = result = getDexNative();
* Returns an array of
Class} objects associated with the parameter types of this
* abstract method. If the method was declared with no parameters, an
* empty array will be returned.
* @return the parameter types
Class&?&[] getParameterTypes() {
Dex dex = declaringClassOfOverriddenMethod.getDex();
short[] types = dex.parameterTypeIndicesFromMethodIndex(dexMethodIndex);
if (types.length == 0) {
return EmptyArray.CLASS;
Class&?&[] parametersArray = new Class[types.length];
for (int i = 0; i & types. i++) {
// Note, in the case of a Proxy the dex cache types are equal.
parametersArray[i] = declaringClassOfOverriddenMethod.getDexCacheType(dex, types[i]);
return parametersA
protected boolean equalMethodParameters(Class&?&[] params) {
Dex dex = declaringClassOfOverriddenMethod.getDex();
short[] types = dex.parameterTypeIndicesFromMethodIndex(dexMethodIndex);
if (types.length != params.length) {
for (int i = 0; i & types. i++) {
if (declaringClassOfOverriddenMethod.getDexCacheType(dex, types[i]) != params[i]) {
protected int compareParameters(Class&?&[] params) {
Dex dex = declaringClassOfOverriddenMethod.getDex();
short[] types = dex.parameterTypeIndicesFromMethodIndex(dexMethodIndex);
int length = Math.min(types.length, params.length);
for (int i = 0; i & i++) {
Class&?& aType = declaringClassOfOverriddenMethod.getDexCacheType(dex, types[i]);
Class&?& bType = params[i];
if (aType != bType) {
int comparison = aType.getName().compareTo(bType.getName());
if (comparison != 0) {
return types.length - params.
* Returns the name of this field.
* @return the name of this field
@Override public String getName() {
if (dexFieldIndex == -1) {
// Proxy classes have 1 synthesized static field with no valid dex index.
if (!declaringClass.isProxy()) {
throw new AssertionError();
return &throws&;
Dex dex = declaringClass.getDex();
int nameIndex = dex.nameIndexFromFieldIndex(dexFieldIndex);
return declaringClass.getDexCacheString(dex, nameIndex);
private Dex loadDexBuffer() throws IOException, DecodeException {
String fileName = file.getName();
if (fileName.endsWith(&.dex&)) {
return new Dex(file);
if (fileName.endsWith(&.class&)) {
return loadFromClassFile(file);
if (fileName.endsWith(&.apk&) || fileName.endsWith(&.zip&)) {
Dex dex = loadFromZip(file);
if (dex == null) {
throw new IOException(&File 'classes.dex' not found in file: & + file);
if (fileName.endsWith(&.jar&)) {
// check if jar contains 'classes.dex'
Dex dex = loadFromZip(file);
if (dex != null) {
return loadFromJar(file);
throw new DecodeException(&Unsupported input file format: & + file);
private static Dex loadFromJar(File jarFile) throws DecodeException {
(&converting to dex: {} ...&, jarFile.getName());
JavaToDex j2d = new JavaToDex();
byte[] ba = j2d.convert(jarFile.getAbsolutePath());
if (ba.length == 0) {
throw new JadxException(j2d.isError() ? j2d.getDxErrors() : &Empty dx output&);
} else if (j2d.isError()) {
LOG.warn(&dx message: {}&, j2d.getDxErrors());
return new Dex(ba);
} catch (Throwable e) {
throw new DecodeException(&java class to dex conversion error:\n & + e.getMessage(), e);
private static Dex loadFromZip(File file) throws IOException {
ZipFile zf = new ZipFile(file);
ZipEntry dex = zf.getEntry(&classes.dex&);
if (dex == null) {
zf.close();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
InputStream in =
in = zf.getInputStream(dex);
byte[] buffer = new byte[8192];
while ((count = in.read(buffer)) != -1) {
bytesOut.write(buffer, 0, count);
} finally {
if (in != null) {
in.close();
zf.close();
return new Dex(bytesOut.toByteArray());
private static Dex loadFromClassFile(File file) throws IOException, DecodeException {
File outFile = File.createTempFile(&jadx-tmp-&, System.nanoTime() + &.jar&);
outFile.deleteOnExit();
FileOutputStream out =
JarOutputStream jo =
out = new FileOutputStream(outFile);
jo = new JarOutputStream(out);
String clsName = AsmUtils.getNameFromClassFile(file);
if (clsName == null) {
throw new IOException(&Can't read class name from file: & + file);
FileUtils.addFileToJar(jo, file, clsName + &.class&);
} finally {
if (jo != null) {
jo.close();
if (out != null) {
out.close();
return loadFromJar(outFile);
Example 10
private Dex loadDexBuffer() throws IOException, DecodeException {
String fileName = file.getName();
if (fileName.endsWith(&.dex&)) {
return new Dex(file);
if (fileName.endsWith(&.class&)) {
return loadFromClassFile(file);
if (fileName.endsWith(&.apk&) || fileName.endsWith(&.zip&)) {
Dex dex = loadFromZip(file);
if (dex == null) {
throw new IOException(&File 'classes.dex' not found in file: & + file);
if (fileName.endsWith(&.jar&)) {
// check if jar contains 'classes.dex'
Dex dex = loadFromZip(file);
if (dex != null) {
return loadFromJar(file);
throw new DecodeException(&Unsupported input file format: & + file);
Example 11
private static Dex loadFromJar(File jarFile) throws DecodeException {
(&converting to dex: {} ...&, jarFile.getName());
JavaToDex j2d = new JavaToDex();
byte[] ba = j2d.convert(jarFile.getAbsolutePath());
if (ba.length == 0) {
throw new JadxException(j2d.isError() ? j2d.getDxErrors() : &Empty dx output&);
} else if (j2d.isError()) {
LOG.warn(&dx message: {}&, j2d.getDxErrors());
return new Dex(ba);
} catch (Throwable e) {
throw new DecodeException(&java class to dex conversion error:\n & + e.getMessage(), e);
Example 12
private static Dex loadFromZip(File file) throws IOException {
ZipFile zf = new ZipFile(file);
ZipEntry dex = zf.getEntry(&classes.dex&);
if (dex == null) {
zf.close();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
InputStream in =
in = zf.getInputStream(dex);
byte[] buffer = new byte[8192];
while ((count = in.read(buffer)) != -1) {
bytesOut.write(buffer, 0, count);
} finally {
if (in != null) {
in.close();
zf.close();
return new Dex(bytesOut.toByteArray());
Example 13
private static Dex loadFromClassFile(File file) throws IOException, DecodeException {
File outFile = File.createTempFile(&jadx-tmp-&, System.nanoTime() + &.jar&);
outFile.deleteOnExit();
FileOutputStream out =
JarOutputStream jo =
out = new FileOutputStream(outFile);
jo = new JarOutputStream(out);
String clsName = AsmUtils.getNameFromClassFile(file);
if (clsName == null) {
throw new IOException(&Can't read class name from file: & + file);
FileUtils.addFileToJar(jo, file, clsName + &.class&);
} finally {
if (jo != null) {
jo.close();
if (out != null) {
out.close();
return loadFromJar(outFile);
Example 14
Dex getDex() {
Dex result =
if (result == null) {
synchronized (this) {
if (result == null) {
dex = result = getDexNative();
Example 15
public String getName() {
if (fieldDexIndex == -1) {
// Proxy classes have 1 synthesized static field with no valid dex index
if (!declaringClass.isProxy()) {
throw new AssertionError();
return &throws&;
Dex dex = declaringClass.getDex();
int nameIndex = dex.nameIndexFromFieldIndex(fieldDexIndex);
return declaringClass.getDexCacheString(dex, nameIndex);
Example 16
Class&?& getType() {
if (fieldDexIndex == -1) {
// The type of the synthesized field in a Proxy class is Class[][]
if (!declaringClass.isProxy()) {
throw new AssertionError();
return Class[][].
Dex dex = declaringClass.getDex();
int typeIndex = dex.typeIndexFromFieldIndex(fieldDexIndex);
return declaringClass.getDexCacheType(dex, typeIndex);
Example 17
public static String getMethodName(ArtMethod artMethod) {
artMethod = artMethod.findOverriddenMethodIfProxy();
Dex dex = artMethod.getDeclaringClass().getDex();
int nameIndex = dex.nameIndexFromMethodIndex(artMethod.getDexMethodIndex());
// Note, in the case of a Proxy the dex cache strings are equal.
return artMethod.getDexCacheString(dex, nameIndex);
Example 18
* Returns true if the given parameters match those of the method in the given order.
public static boolean equalConstructorParameters(ArtMethod artMethod, Class&?&[] params) {
Dex dex = artMethod.getDeclaringClass().getDex();
short[] types = dex.parameterTypeIndicesFromMethodIndex(artMethod.getDexMethodIndex());
if (types.length != params.length) {
for (int i = 0; i & types. i++) {
if (artMethod.getDexCacheType(dex, types[i]) != params[i]) {

我要回帖

更多关于 bytecode verifier 的文章

 

随机推荐