Exp build:android failed.

Here’s the build status page: https://expo.io/builds/bae9c96c-3d7d-4a34-88c4-991ac16f6050

Can someone help how to fix this?

[stderr] /src/exponent/android-shell-app/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/AlertFragment.java:37: Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment]
[stderr]   public AlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {
[stderr]          ~~~~~~~~~~~~~
[stderr] /src/exponent/android-shell-app/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/SupportAlertFragment.java:30: Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment]
[stderr]   public SupportAlertFragment(@Nullable DialogModule.AlertFragmentListener listener, Bundle arguments) {
[stderr]          ~~~~~~~~~~~~~~~~~~~~
[stderr]    Explanation for issues of type "ValidFragment":
[stderr]    From the Fragment documentation:
[stderr]    Every fragment must have an empty constructor, so it can be instantiated
[stderr]    when restoring its activity's state. It is strongly recommended that
[stderr]    subclasses do not have other constructors with parameters, since these
[stderr]    constructors will not be called when the fragment is re-instantiated;
[stderr]    instead, arguments can be supplied by the caller with setArguments(Bundle)
[stderr]    and later retrieved by the Fragment with getArguments().
[stderr]    http://developer.android.com/reference/android/app/Fragment.html#Fragment()
[stderr] 2 errors, 0 warnings
:app:transformClassesWithMultidexlistForProdRelease
:app:transformClassesWithDexForProdRelease
[stderr] Dex: Error converting bytecode to dex:
[stderr] Cause: Dex cannot parse version 52 byte code.
[stderr] This is caused by library dependencies that have been compiled using Java 8 or above.
[stderr] If you are using the 'java' gradle plugin in a library submodule add 
[stderr] targetCompatibility = '1.7'
[stderr] sourceCompatibility = '1.7'
[stderr] to that submodule's build.gradle file.
[stderr]     UNEXPECTED TOP-LEVEL EXCEPTION:
[stderr]     java.lang.RuntimeException: Exception parsing classes
[stderr]     	at com.android.dx.command.dexer.Main.processClass(Main.java:781)
[stderr]     	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:747)
[stderr]     	at com.android.dx.command.dexer.Main.access$1200(Main.java:88)
[stderr]     	at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1689)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[stderr]     	at com.android.dx.command.dexer.Main.processOne(Main.java:695)
[stderr]     	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:560)
[stderr]     	at com.android.dx.command.dexer.Main.runMultiDex(Main.java:376)
[stderr]     	at com.android.dx.command.dexer.Main.run(Main.java:290)
[stderr]     	at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)
[stderr]     	at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:174)
[stderr]     	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[stderr]     	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[stderr]     	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[stderr]     	at java.lang.Thread.run(Thread.java:748)
[stderr]     Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:476)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[stderr]     	at com.android.dx.command.dexer.Main.parseClass(Main.java:793)
[stderr]     	at com.android.dx.command.dexer.Main.access$1600(Main.java:88)
[stderr]     	at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1728)
[stderr]     	at com.android.dx.command.dexer.Main.processClass(Main.java:779)
[stderr]     	... 16 more
[stderr]     
[stderr] Dex: Error converting bytecode to dex:
[stderr] Cause: Dex cannot parse version 52 byte code.
[stderr] This is caused by library dependencies that have been compiled using Java 8 or above.
[stderr] If you are using the 'java' gradle plugin in a library submodule add 
[stderr] targetCompatibility = '1.7'
[stderr] sourceCompatibility = '1.7'
[stderr] to that submodule's build.gradle file.
[stderr]     UNEXPECTED TOP-LEVEL EXCEPTION:
[stderr]     java.lang.RuntimeException: Exception parsing classes
[stderr]     	at com.android.dx.command.dexer.Main.processClass(Main.java:781)
[stderr]     	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:747)
[stderr]     	at com.android.dx.command.dexer.Main.access$1200(Main.java:88)
[stderr]     	at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1689)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[stderr]     	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[stderr]     	at com.android.dx.command.dexer.Main.processOne(Main.java:695)
[stderr]     	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:587)
[stderr]     	at com.android.dx.command.dexer.Main.runMultiDex(Main.java:376)
[stderr]     	at com.android.dx.command.dexer.Main.run(Main.java:290)
[stderr]     	at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)
[stderr]     	at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:174)
[stderr]     	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[stderr]     	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[stderr]     	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[stderr]     	at java.lang.Thread.run(Thread.java:748)
[stderr]     Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:476)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[stderr]     	at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[stderr]     	at com.android.dx.command.dexer.Main.parseClass(Main.java:793)
[stderr]     	at com.android.dx.command.dexer.Main.access$1600(Main.java:88)
[stderr]     	at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1728)
[stderr]     	at com.android.dx.command.dexer.Main.processClass(Main.java:779)
[stderr]     	... 16 more
[stderr]     
[stderr] 2 errors; aborting
 FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:transformClassesWithDexForProdRelease'.
[stderr] > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

I am also getting this error. I was able to build successfully last week. The only change I made was adding an icon to the notification.icon in app.json.

I’m thinking this is a gradle issue.

Is there solution to fix it :frowning:

same here

Hi, we’re really sorry about this. We’re deploying a fix right now, which should be available soon. You can see updates at https://status.expo.io/ . Let us know if you continue to have issues after the fix is deployed!

Hi,

can you explain what kind of fix you applied? We have the same problem from an ejected app

thnx,

Marc

Hi, really need to know how to fix this my side. Like @marc.weeber , I also have an ejected app and cannot build because of this error. Cheers.

@joaopiopedreira, @marc.weeber,

This thread helped me out: Android Standalone build failed - #18 by rmaniar

I updated the lottie dependency from 2.5.+ to 2.5.5 in android/app/build.gradle and also updated its version references in the following:

android/maven/host/exp/exponent/expoview/28.0.0/expoview-28.0.0.pom
android/maven/host/exp/exponent/expoview/28.0.0/ivy-28.0.0.xml

Those updates along with a rebuild got the project running again, good luck!

Hi @marc.weeber @joaopiopedreira - sorry for the trouble. What @vgeyvandov suggested should work, however we’ve also put out an update to expokit that fixes this issue, so you can follow the normal upgrade instructions here instead if that’s easier for you: https://docs.expo.io/versions/v28.0.0/expokit/expokit#upgrading-expokit

Hi @esamelson, that worked, but only after I’ve merged the diff in android/app/build.gradle with the version in your update (from https://expo.io/--/api/v2/versions). The upgrade instruction (https://docs.expo.io/versions/v28.0.0/expokit/expokit#android) do not mention that and maybe they should? Cheers.

Sorry guys, the instructions DO mention that. My mistake!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.