creator2.4.11编译安卓包报错

  • Creator 版本: creator2.4.11

  • 目标平台: Android

  • 重现方式:编译Android 报错

  • 首个报错: Task ‘:libcocos2dx:compileDebugJavaWithJavac’ is not up-to-date because:
    Value of input property ‘toolChain.version’ has changed for task ‘:libcocos2dx:compileDebugJavaWithJavac’
    The input changes require a full rebuild for incremental task ‘:libcocos2dx:compileDebugJavaWithJavac’.
    Transforming com.android.vending.expansion.zipfile.jar with IdentityTransform
    Transforming com.android.vending.expansion.zipfile.jar with IdentityTransform
    Transforming okhttp-3.12.14.jar with IdentityTransform
    Transforming okhttp-3.12.14.jar with IdentityTransform
    Transforming okio-1.15.0.jar with IdentityTransform
    Transforming okio-1.15.0.jar with IdentityTransform
    Invalidating in-memory cache of E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\6.7.1\javaCompile\classAnalysis.bin
    Invalidating in-memory cache of E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\6.7.1\javaCompile\jarAnalysis.bin
    Invalidating in-memory cache of E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\6.7.1\javaCompile\taskHistory.bin
    Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
    file or directory ‘E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\main\java’, not found
    file or directory ‘E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\debug\java’, not found
    file or directory ‘E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\generated\aidl_source_output_dir\debug\out’, not found
    file or directory ‘E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\generated\renderscript_source_output_dir\debug\out’, not found
    Compiling with JDK Java compiler API.
    :libcocos2dx:compileDebugJavaWithJavac (Thread[Execution worker for ‘:’ Thread 6,5,main]) completed. Took 0.18 secs.

Task :client_gzsg:processDebugMainManifest FAILED
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
Caching disabled for task ‘:client_gzsg:processDebugMainManifest’ because:
Build cache is disabled
Task ‘:client_gzsg:processDebugMainManifest’ is not up-to-date because:
No history is available.
The input changes require a full rebuild for incremental task ‘:client_gzsg:processDebugMainManifest’.
Unable do incremental execution: full task run
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
Loading library manifest E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\merged_manifest\debug\AndroidManifest.xml
Merging main manifest E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\AndroidManifest.xml

Merging library manifest E:\CreatorEditors\Creator\2.4.11\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\merged_manifest\debug\AndroidManifest.xml
Merging manifest with lower [:libcocos2dx] AndroidManifest.xml:2:1-11:12
uses-sdk defined in both files…
Merging uses-sdk with lower [:libcocos2dx] AndroidManifest.xml:5:5-7:41
uses-permission#android.permission.ACCESS_NETWORK_STATE defined in both files…
Merging uses-permission#android.permission.ACCESS_NETWORK_STATE with lower [:libcocos2dx] AndroidManifest.xml:9:5-79
:client_gzsg:processDebugMainManifest (Thread[Execution worker for ‘:’ Thread 7,5,main]) completed. Took 0.05 secs.

Task :client_gzsg:mergeDebugResources
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
Caching disabled for task ‘:client_gzsg:mergeDebugResources’ because:
Build cache is disabled
Task ‘:client_gzsg:mergeDebugResources’ is not up-to-date because:
No history is available.
The input changes require a full rebuild for incremental task ‘:client_gzsg:mergeDebugResources’.
Unable do incremental execution: full task run
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\libs’, not found
file or directory ‘E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
Compiling XML table E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\values_values.arsc.flat
Compiling XML table E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-zh-rCN\values-zh-rCN.xml to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\values-zh-rCN_values-zh-rCN.arsc.flat
Compiling image file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-xhdpi\ic_launcher.png
Compiling image file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-mdpi\ic_launcher.png
Compiling file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-xhdpi\ic_launcher.png to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\mipmap-xhdpi_ic_launcher.png.flat
Compiling image file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-hdpi\ic_launcher.png
Compiling file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-mdpi\ic_launcher.png to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\mipmap-mdpi_ic_launcher.png.flat
Compiling file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-hdpi\ic_launcher.png to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\mipmap-hdpi_ic_launcher.png.flat
Compiling image file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-xxhdpi\ic_launcher.png
Compiling file E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\res\mipmap-xxhdpi\ic_launcher.png to E:\XPOld\client_gzsg\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\merged\debug\mipmap-xxhdpi_ic_launcher.png.flat
:client_gzsg:mergeDebugResources (Thread[Execution worker for ‘:’,5,main]) completed. Took 0.274 secs.

Task :instantapp:processDebugManifestForPackage
Caching disabled for task ‘:instantapp:processDebugManifestForPackage’ because:
Build cache is disabled
Task ‘:instantapp:processDebugManifestForPackage’ is not up-to-date because:
No history is available.
:instantapp:processDebugManifestForPackage (Thread[Execution worker for ‘:’ Thread 8,5,main]) completed. Took 0.284 secs.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:libcocos2dx:compileDebugJavaWithJavac’.

java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x9c1c6aa) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x9c1c6aa

  • 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.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:client_gzsg:processDebugMainManifest’.

Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not “opens java.io” to unnamed module @27f62f5b

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug29 actionable tasks: 10 executed, 19 up-to-date
    option to get more log output. Run with --scan to get full insights.
    ==============================================================================

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

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

用android studio 可以编译成功 cocos create中编译失败

编译成功了?

jdk 的版本不对

一般默认的是 8, 重新下载一个 11.0 的版本就行了
image

我是17了也不行

问题解决了吗