打包Android出现Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector

Building mode: debug
Using Android Studio project : /Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio
Building apk…
running: ‘"/Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio/gradlew" --parallel --info assembleDebug’

Initialized native services in: /Users/fengyangzhang/.gradle/native
The client will now receive all logging from the daemon (pid: 8146). The daemon log file: /Users/fengyangzhang/.gradle/daemon/4.10.3/daemon-8146.out.log
Starting 2nd build in daemon [uptime: 1 mins 57.044 secs, performance: 99%, no major garbage collections]
Using 8 worker leases.
Starting Build
Settings evaluated using settings file ‘/Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio/settings.gradle’.
Projects loaded. Root project using build file ‘/Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio/build.gradle’.
Included projects: [root project ‘proj.android-studio’, project ‘:fcq’, project ‘:game’, project ‘:instantapp’, project ‘:libcocos2dx’]
Parallel execution is an incubating feature.

Configure project :
Evaluating root project ‘proj.android-studio’ using build file ‘/Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio/build.gradle’.

Configure project :fcq
Evaluating project ‘:fcq’ using build file ‘/Users/fengyangzhang/Documents/github/fcqgame/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build.gradle’.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugApk
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
Parsing /Volumes/Transcend/android-sdk-macosx/add-ons/addon-google_apis-google-23/package.xml

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:fcq’.

Failed to notify project evaluation listener.
Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s
Error running command, return code: 1.

我也遇到这个问题了。楼主解决了吗

同问,解决了吗?

已解决
经过仔细排查,发现在线安装creator的时候,有时候会缺少相关库及文件
遇到这个情况可以试着先卸载对应的creator版本,然后重新安装。
以上仅为个人解决方案,仅供参考

同样的问题,重装了几次cocos还是不行,版本2.4.5

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。