当前位置: 首页 > 工具软件 > JUniversal > 使用案例 >

java手机翻译,使用JUniversal翻译Android项目

路欣荣
2023-12-01

安装J2Objc之后我正在使用JUniversal将android项目的Java类转换为Objective-C并且在这个Link上从Mac OS X(Yosemite)克隆juniversal和jsimple,当我在命令下运行到终端时:

./gradlew build install javaToObjectiveC -x test

它显示我的错误:

:libraries:jsimple-io:javaToObjectiveC FAILED FAILURE:构建因异常而失败 . 出了什么问题:任务执行失败':libraries:jsimple-io:javaToObjectiveC' . 进程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java''以非零退出值4完成尝试:使用--stacktrace选项运行以获取堆栈跟踪 . 使用--info或--debug选项运行以获取更多日志输出 . 建筑失败

此外,还定义了$ HOME目录中的文件 .bash_profile :

export ANDROID_HOME=/usr/local/opt/android-sdk

export GRADLE_HOME=/Users/emaar/env/gradle

export M2_HOME=$HOME/env/maven

export JAVA_HOME2=/usr/libexec/java_home

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home

export J2OBJC_HOME=/Users/emaar/env/j2objc

export PATH=$PATH:$M2_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$GRADLE_HOME/bin:$J2OBJC_HOME:$JAVA_HOME

我用的时候:

$ ./gradlew build install javaToCSharp -x test

它显示 BUILD SUCCESSFUL 没有错误

我也尝试命令:

./gradlew build install javaToObjectiveC -x test --stacktrace

翻译/Users/emaar/jsimple/libraries/jsimple-io/src/main/java/jsimple/pushnotifications/PushNotificationsReceiver.java:library:jsimple-io:javaToObjectiveC FAILED FAILURE:构建因异常而失败 . 出了什么问题:任务执行失败':libraries:jsimple-io:javaToObjectiveC' . 进程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java''以非零退出值4完成尝试:使用--info或--debug选项运行以获得更多日志输出 . 例外情况是:org.gradle.api.tasks.TaskExecutionException:任务执行失败':libraries:jsimple-io:javaToObjectiveC' . 在org.gradle上的org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)位于org.gradle.api.internal的org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)上的.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)位于org.gradle.api.internal.tasks.execution的org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42).tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) .skipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecu at.exe.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)中的ter.execute(ExecuteAtMostOnceTaskExecuter.java:43)org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)at org.gradle.execution.taskgraph .defaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)at org . grag.exe.exe.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)org.gradle.execution.DefaultBuildExecuter.access $ 200(DefaultBuildExecuter.java:23)org.gradle.executio n.DefaultBuildExecuter $ 2.proceed(DefaultBuildExecuter.java:68)org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)at org . grag.exe.exe.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)at org .gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter.java:80)at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction) .java:33)在org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)atOrg.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)org.gradle.launcher.cli.RunBuildAction.run( RunBuildAction.java:51)org.gradle.internal.Actions $ RunnableActionAdapter.execute(Actions.java:171)org.gradle.launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:237)atg.gradle .launcher.cli.CommandLineActionFactory $ ParseAndBuildAction.execute(CommandLineActionFactory.java:210)org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction) .java:24)atg.gradle.launcher.cli.CommandLineActionFactory $ WithLog.exedle.launcher.cli.CommandLineActionFactory $ WithLogging.exe(CommandLineActionFactory.java:169)atO.Logging.exe位于org.gradle.launcher.Main.doAction的Org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)中的rg.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) java:33)org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)atg.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)at org.gradle.launcher.bootstrap . org.gradle.ladleher.GradleMain.main(GradleMain.java:23)中的.ProcessBootstrap.run(ProcessBootstrap.java:35)位于org.gradle的org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) . wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)引起:org.gradle.process.internal.ExecException:进程'命令'/ Library / Java /javaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java''在org.gradle.process.internal.DefaultExecHandle $ ExecResultImpl.as中以非零退出值4结束segNormalExitValue(DefaultExecHandle.java:365)org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)org.gradle.api.tasks.JavaExec.exec(JavaExec.java:60)atg.juniversal位于org.juniversal.buildtools.com上的.buildtools.gradle.support.GradleJavaExec.exec(GradleJavaExec.java:59)org.juniversal.buildtools.com.JavaToObjectiveC.translateSourceType(JavaToObjectiveC.java:98).Translator.translate(Translator) .java:78)org.juniversal.buildtools.gradle.JavaToObjectiveCTask.translate(JavaToObjectiveCTask.java:59)位于org.gradle.api的org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) . 在org.gradle.api的org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)中的internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218) . internal.project.taskfactory.AnnotationProcessingTaskFacto在org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:579)org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask . )中的$ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200) . java:562)org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 47更多BUILD FAILED总时间:17.897秒

 类似资料: