Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

:transformClassesWithDexForF0F1F2Debug FAILED #62

Closed
jiwonyune opened this issue Jun 22, 2016 · 2 comments
Closed

:transformClassesWithDexForF0F1F2Debug FAILED #62

jiwonyune opened this issue Jun 22, 2016 · 2 comments

Comments

@jiwonyune
Copy link

I added the firbase plugin into my app.

I initially had this error:

:transformClassesWithDexForF0F1F2Debug

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

So I tried to fix it with the following code from this link (NativeScript/android#344):

android {
    defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
    }
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

But, then, I get this error...

:transformClassesWithDexForF0F1F2Debug

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at com.android.dx.cf.code.LocalVariableList.set(LocalVariableList.java:147)
    at com.android.dx.cf.direct.StdAttributeFactory.parseLocalVariables(StdAttributeFactory.java:586)
    at com.android.dx.cf.direct.StdAttributeFactory.localVariableTable(StdAttributeFactory.java:517)
    at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory.java:178)
    at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:96)
    at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:141)
    at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
    at com.android.dx.cf.direct.AttributeListParser.getList(AttributeListParser.java:106)
    at com.android.dx.cf.direct.StdAttributeFactory.code(StdAttributeFactory.java:300)
    at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory.java:139)
    at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:96)
    at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:141)
    at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
    at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96)
    at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213)
    at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
    at com.android.dx.cf.direct.MethodListParser.getList(MethodListParser.java:54)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:542)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)

:transformClassesWithDexForF0F1F2Debug FAILED

FAILURE: Build failed with an exception.

By the way, I rebuild my android platform everytime I get an error, just in case.

For your information:

This is what my app.gradle looks like right now:

android {
  defaultConfig {
    applicationId "com.indoorcycling.android"
    multiDexEnabled true
    generatedDensities = []
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

Other files, like build.gradle, package.json, or google-services.json, look good.

How can I fix this error? It doesn't look so simple and seems like it requires some understanding of Android Native. Any help would be appreciated.

@jiwonyune
Copy link
Author

Oh, I found a solution. I am no longer getting the error after I changed app.gradle as follows:

android {
  defaultConfig {
    applicationId "com.indoorcycling.android"
    multiDexEnabled true
    generatedDensities = []
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
  dexOptions {
    javaMaxHeapSize "4g"
  }
}

Thanks to this: NativeScript/nativescript-cli#1542 (comment)

@EddyVerbruggen
Copy link
Owner

Ha, just wanted to say that (the javaMaxHeapSize bit) - I'm adding it to the readme

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants