JavaFXPorts MySqlDB-Driver包含在项目中:dex错误

JavaFXPorts MySqlDB-Driver包含在项目中:dex错误,第1张

概述我想创建一个使用MySqlDB连接的app/desktopapp.我在Netbeans中使用了Gluon插件.当我想编译桌面应用程序时,一切正常.但是,当我想为Android编译应用程序时–>它崩溃了信息:JDK:8u65Netbean版本:8.0.2错误:Executing:gradle:android:compileJavaUP-TO-DATE:compileRetrolam

我想创建一个使用MySqlDB连接的app / desktopapp.
我在Netbeans中使用了gluon插件.当我想编译桌面应用程序时,一切正常.但是,当我想为Android编译应用程序时 – >它崩溃了

信息:
JDK:8u65
Netbean版本:8.0.2
错误:

Executing: gradle :androID:compileJava UP-TO-DATE:compileRetrolambdamain UP-TO-DATE:processResources UP-TO-DATE:classes UP-TO-DATE:compileAndroIDJava UP-TO-DATE:compileRetrolambdaAndroID SKIPPED:compileEmbeddedJava UP-TO-DATE:compileRetrolambdaEmbedded SKIPPED:compileTestJava UP-TO-DATE:compileRetrolambdaTest SKIPPED:compileRetrolambda UP-TO-DATE:mergeClassesIntoJar:valIDateManifest:collectMultIDexComponents:shrinkMultIDexComponents:createMainDexList[ant:java] Java Result: 1:dex FailedFAILURE: Build Failed with an exception.* What went wrong:Execution Failed for task ':dex'.> UNEXPECTED top-LEVEL EXCEPTION:  java.lang.RuntimeException: Exception parsing classes    at com.androID.dx.command.dexer.Main.processClass(Main.java:752)    at com.androID.dx.command.dexer.Main.processfileBytes(Main.java:718)    at com.androID.dx.command.dexer.Main.access00(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)    at com.androID.dx.command.dexer.Main.processAllfiles(Main.java:569)    at com.androID.dx.command.dexer.Main.runMultIDex(Main.java:366)    at com.androID.dx.command.dexer.Main.run(Main.java:275)    at com.androID.dx.command.dexer.Main.main(Main.java:245)    at com.androID.dx.command.Main.main(Main.java:106)  Caused by: com.androID.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)    at com.androID.dx.cf.direct.DirectClassfile.parse0(DirectClassfile.java:472)    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.access00(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)    ... 12 more  1 error; aborting* Try:Run with --stacktrace option to get the stack trace. Run with --info or --deBUG option to get more log output.BUILD FailedTotal time: 31.309 secsBuild failure (see the Notifications window for stacktrace): gradle :androID

这是build.gradle:

buildscript {    repositorIEs {        jcenter()    }    dependencIEs {        classpath 'org.javafxports:jfxmobile-plugin:1.0.6'    }}apply plugin: 'org.javafxports.jfxmobile'repositorIEs {      jcenter()   }    dependencIEs {    compile filetree(dir: 'lib', include: ['*.jar'])    }mainClassname = 'com.MysqLtestwitchjavafx.MysqLTestWitchJAVAFX'jfxmobile {    androID {                manifest = 'src/androID/AndroIDManifest.xml'        jfxmobile.androID.androIDSdk = 'G:/AndroID'    }    ios {        infoPList = file('src/ios/Default-Info.pList')    }}

这是完整的堆栈跟踪:

Issue 1--------  Requested project: C:\Users\Merduma\documents\NetBeansprojects\MysqLTestWitchJAVAFX  Stack trace:    org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.2.1-bin.zip'.        at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:57)        at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.run(DefaultAsyncConsumerActionExecutor.java:57)        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)        at org.gradle.internal.concurrent.StoppableExecutorImpl.run(StoppableExecutorImpl.java:40)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)        at java.lang.Thread.run(Thread.java:745)        at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)        at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:71)        at org.netbeans.gradle.project.tasks.AsyncGradleTask.runBuild(AsyncGradleTask.java:322)        at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoretaskdefCancel(AsyncGradleTask.java:427)        at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgressIgnoretaskdefCancel(AsyncGradleTask.java:354)        at org.netbeans.gradle.project.tasks.AsyncGradleTask.doGradleTasksWithProgress(AsyncGradleTask.java:346)        at org.netbeans.gradle.project.tasks.AsyncGradleTask.access0(AsyncGradleTask.java:76)        at org.netbeans.gradle.project.tasks.AsyncGradleTask$BuildExecutionItem.run(AsyncGradleTask.java:697)        at org.netbeans.gradle.project.tasks.GradleDaemonManager.runBlockingGradleTask(GradleDaemonManager.java:52)        at org.netbeans.gradle.project.tasks.GradleDaemonManager.access0(GradleDaemonManager.java:23)        at org.netbeans.gradle.project.tasks.GradleDaemonManager.execute(GradleDaemonManager.java:129)        at org.jtrim.concurrent.AbstractTaskExecutorService$FunctionWrapper.execute(AbstractTaskExecutorService.java:270)        at org.jtrim.concurrent.AbstractTaskExecutorService$TaskOfAbstractExecutor.execute(AbstractTaskExecutorService.java:340)        at org.jtrim.concurrent.Tasks$RunOnceCancelableTask.execute(Tasks.java:342)        at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$QueuedItem.runTask(ThreadPoolTaskExecutor.java:1213)        at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.executeTask(ThreadPoolTaskExecutor.java:1049)        at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:1179)        at org.jtrim.concurrent.ThreadPoolTaskExecutor$ThreadPoolTaskExecutorImpl$Worker.run(ThreadPoolTaskExecutor.java:998)        at java.lang.Thread.run(Thread.java:745)    Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution Failed for task ':dex'.        at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:77)        at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)        at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)        at org.gradle.initialization.DefaultGradleLauncher.dobuild(DefaultGradleLauncher.java:108)        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)        at org.gradle.tooling.internal.provIDer.BuildModelAction.run(BuildModelAction.java:43)        at org.gradle.tooling.internal.provIDer.BuildModelAction.run(BuildModelAction.java:30)        at org.gradle.tooling.internal.provIDer.ConfiguringBuildAction.run(ConfiguringBuildAction.java:119)        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.dobuild(ExecuteBuild.java:47)        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.WatchFordisconnection.execute(WatchFordisconnection.java:35)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.resetDeprecationLogger.execute(resetDeprecationLogger.java:24)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:71)        at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.call(ForwardClIEntinput.java:69)        at org.gradle.util.Swapper.swap(Swapper.java:38)        at org.gradle.launcher.daemon.server.exec.ForwardClIEntinput.execute(ForwardClIEntinput.java:69)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.LogToClIEnt.dobuild(LogToClIEnt.java:60)        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.dobuild(EstablishBuildEnvironment.java:70)        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.DaemonhygieneAction.execute(DaemonhygieneAction.java:39)        at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)        at org.gradle.launcher.daemon.server.exec.StartBuildOrResponDWithBusy.run(StartBuildOrResponDWithBusy.java:46)        at org.gradle.launcher.daemon.server.DaemonStateCoordinator.run(DaemonStateCoordinator.java:246)        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl.run(DefaultExecutorFactory.java:64)    Caused by: org.gradle.API.tasks.TaskExecutionException: Execution Failed for task ':dex'.        at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)        at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)        at org.gradle.API.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)        at org.gradle.API.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)        at org.gradle.API.internal.tasks.execution.ValIDatingTaskExecuter.execute(ValIDatingTaskExecuter.java:58)        at org.gradle.API.internal.tasks.execution.SkipEmptySourcefilesTaskExecuter.execute(SkipEmptySourcefilesTaskExecuter.java:42)        at org.gradle.API.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)        at org.gradle.API.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)        at org.gradle.API.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)        at org.gradle.API.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processtask(AbstractTaskPlanExecutor.java:63)        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)        at org.gradle.execution.DefaultBuildExecuter.access0(DefaultBuildExecuter.java:23)        at org.gradle.execution.DefaultBuildExecuter.proceed(DefaultBuildExecuter.java:68)        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)        at org.gradle.initialization.DefaultGradleLauncher.dobuildStages(DefaultGradleLauncher.java:149)        at org.gradle.initialization.DefaultGradleLauncher.dobuild(DefaultGradleLauncher.java:106)        ... 32 more    Caused by: org.gradle.API.GradleException: UNEXPECTED top-LEVEL EXCEPTION:    java.lang.RuntimeException: Exception parsing classes        at com.androID.dx.command.dexer.Main.processClass(Main.java:752)        at com.androID.dx.command.dexer.Main.processfileBytes(Main.java:718)        at com.androID.dx.command.dexer.Main.access00(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)        at com.androID.dx.command.dexer.Main.processAllfiles(Main.java:569)        at com.androID.dx.command.dexer.Main.runMultIDex(Main.java:366)        at com.androID.dx.command.dexer.Main.run(Main.java:275)        at com.androID.dx.command.dexer.Main.main(Main.java:245)        at com.androID.dx.command.Main.main(Main.java:106)    Caused by: com.androID.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)        at com.androID.dx.cf.direct.DirectClassfile.parse0(DirectClassfile.java:472)        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.access00(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)        ... 12 more    1 error; aborting        at org.javafxports.jfxmobile.plugin.androID.task.Dex.dex(Dex.groovy:57)        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)        at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)        at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)        at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)        at org.gradle.API.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)        at org.gradle.API.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)        at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)        at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)        ... 55 more

谢谢,我希望你能帮助我.

解决方法:

我尝试过使用最新的mysql-connector驱动程序(5.1.37),并且在构建apk时遇到了同样的异常.

此异常似乎与用于编译driver的JDK的某些问题有关,而不是与AndroID上不支持的MysqL有关.

所以在这篇文章的answer之后,我使用了旧版本的驱动程序:

buildscript {    repositorIEs {        jcenter()    }    dependencIEs {        classpath 'org.javafxports:jfxmobile-plugin:1.0.6'    }}apply plugin: 'org.javafxports.jfxmobile'repositorIEs {    jcenter()}dependencIEs {    compile 'MysqL:mysql-connector-java:3.1.12'}mainClassname = 'com.gluonhq.testsql.Testsql'jfxmobile {    androID {        manifest = 'src/androID/AndroIDManifest.xml'        packagingOptions {            exclude 'meta-inf/INDEX.List'        }    }    ios {        forcelinkClasses = [ 'com.gluonhq.**.*', 'com.MysqL.**.*']        infoPList = file('src/ios/Default-Info.pList')    }}

我能够构建项目并在桌面,AndroID和iOS上成功运行.

编辑

对于iOS,使用较新版本的驱动程序(3.1.13)会导致编码exceptions.

总结

以上是内存溢出为你收集整理的JavaFXPorts MySqlDB-Driver包含在项目中:dex错误全部内容,希望文章能够帮你解决JavaFXPorts MySqlDB-Driver包含在项目中:dex错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1100853.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存