当前无法建立我的博览会APK,不确定原因。
我刚刚从台式机上获取了最新版本,但以前在笔记本电脑上构建时,它可以正常工作。
无论如何,当我对其进行测试时,该应用程序可以正常运行,并且可以确认我拉出了最新版本的应用程序。
iPhone的构建工作正常,但Android则失败。 这是错误日志:
: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
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9 mins 20.306 secs
我对Java不熟悉,因此无法跟踪它出了什么问题。
我的app.json
文件如下所示:
{
"expo": {
"name": "myApp",
"icon": "./src/images/myApp.png",
"version": "1.1.1",
"description": "myApp description",
"sdkVersion": "25.0.0",
"ios": {
"bundleIdentifier": "com.myApp.myApp",
"infoPlist": {
"LSApplicationQueriesSchemes": ["whatsapp"],
"NSCameraUsageDescription":
"This app uses the camera"
}
},
"android": {
"package": "com.myApp.myApp",
"versionCode": 4
},
"splash": {
"image": "./assets/spashpage.png",
"resizeMode": "cover"
}
}
}
有人知道原因吗?