cocos creator 2.0.8 打包APK黑屏

浏览器,模拟器正常运行,打包APK安装后黑屏卡死
之前看到帖子有人加了无用变量和引用改了没事了,我也改了但是没有效果
华为手机,之前做过其他项目没有事,hellowworld也能打包运行跪求大佬解

  • Creator 版本: 2.0.8

  • 目标平台: android

  • 重现方式:

  • 首个报错:

  • 之前哪个版本是正常的: hellowworld

这是日志文档
No history is available.
All input files are considered out-of-date for incremental task ‘:libcocos2dx:generateReleaseRFile’.
Unable do incremental execution: full task run
:libcocos2dx:generateReleaseRFile (Thread[Daemon worker,5,main]) completed. Took 0.072 secs.
:libcocos2dx:generateReleaseSources (Thread[Daemon worker,5,main]) started.
:libcocos2dx:generateReleaseSources
Skipping task ‘:libcocos2dx:generateReleaseSources’ as it has no actions.
:libcocos2dx:generateReleaseSources (Thread[Daemon worker,5,main]) completed. Took 0.0 secs.
:libcocos2dx:compileReleaseJavaWithJavac (Thread[Daemon worker,5,main]) started.
:libcocos2dx:compileReleaseJavaWithJavac
Putting task artifact state for task ‘:libcocos2dx:compileReleaseJavaWithJavac’ into context took 0.0 secs.
Deleting stale output file: D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\generated\source\apt\release
Deleting stale output file: D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\classes\release
Successfully started process ‘command ‘D:\tool\android\android\android-ndk-r16b\ndk-build.cmd’’
file or directory ‘D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\main\java’, not found
file or directory ‘D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\main\java’, not found
file or directory ‘D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\release\java’, not found
Up-to-date check for task ‘:libcocos2dx:compileReleaseJavaWithJavac’ took 1.353 secs. It is not up-to-date because:
No history is available.
All input files are considered out-of-date for incremental task ‘:libcocos2dx:compileReleaseJavaWithJavac’.
Compiling with source level 1.8 and target level 1.8.
Creating new cache for classAnalysis, path D:\workspace\Puzzle\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.4\javaCompile\classAnalysis.bin, access org.gradle.cache.internal.DefaultCacheAccess@7a29ad5b
Creating new cache for jarAnalysis, path D:\workspace\Puzzle\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.4\javaCompile\jarAnalysis.bin, access org.gradle.cache.internal.DefaultCacheAccess@7a29ad5b
Creating new cache for taskJars, path D:\workspace\Puzzle\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.4\javaCompile\taskJars.bin, access org.gradle.cache.internal.DefaultCacheAccess@7a29ad5b
Creating new cache for taskHistory, path D:\workspace\Puzzle\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.4\javaCompile\taskHistory.bin, access org.gradle.cache.internal.DefaultCacheAccess@7a29ad5b
:libcocos2dx:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
file or directory ‘D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\main\java’, not found
file or directory ‘D:\tool\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\src\release\java’, not found
Compiling with JDK Java compiler API.
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。

2.3.3 我也报过类似的错误, 你用AS打包试试,我这边creator打包报错,使用AS打包可以运行,creator 打包helloworld也正常

找到问题了,是代码的问题,之前的文件引用写法const {abc}= require("./name") 打包android运行黑屏 改成const {abc}= require(’name’)后可以正常运行了

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