Cocos Creator Android Compile Error

Hello,
I use Cocos Creator and when I tried to compile, there is an error, but I can build.

The error is ; [Error: Compile failed. The log file path [ C:\Users\Rhodier.CocosCreator\logs\native.log ]]

Log :

Updated project.properties
Updated local.properties
Updated file C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android\proguard-project.txt
Updated project.properties
Updated local.properties
Updated file C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java\proguard-project.txt
Le chemin d'accƠs sp‚cifi‚ est introuvable.
Building mode: release
Using Eclipse project : C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android
Android platform not specified, searching a default one...
running: '"C:\Users\Rhodier\AppData\Local\Android\sdk\tools\android" update project -t android-23 -p C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android'

Android platform not specified, searching a default one...
running: '"C:\Users\Rhodier\AppData\Local\Android\sdk\tools\android" update lib-project -p C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java -t android-23'

Building native...
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
running: '"C:\Users\Rhodier\AppData\Local\Android\android-ndk-r10e\ndk-build" -C C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android -j4 NDK_MODULE_PATH=C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android\../../cocos2d-x;C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android\../../cocos2d-x/cocos;C:\Users\Rhodier\Documents\test\build\jsb-default\frameworks\runtime-src\proj.android\../../cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.9'

Error running command, return code: 1.

hi @Minpik,

this error usually occurs in cocos creator 1.0+ so to fix this You can try checking your path of dependencies in preferences and make sure there is no space between the path specified.

let me know what happens

This is preferences :

1 Like

@Minpik try NDK 10b instead

@Undercode
with NDK 10b :

Updated project.properties
Updated local.properties
Updated file C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android\proguard-project.txt
Updated project.properties
Updated local.properties
Updated file C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java\proguard-project.txt
Android NDK: ERROR:C:/Users/Rhodier/AppData/Local/Android/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/Android.mk:gnustl_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that C:/Users/Rhodier/AppData/Local/Android/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/thumb/libgnustl_static.a exists or that its path is correct
make.exe: Entering directory C:/Users/Rhodier/Documents/tutorial-duang-sheep-master/build/jsb-default/frameworks/runtime-src/proj.android' make.exe: Leaving directoryC:/Users/Rhodier/Documents/tutorial-duang-sheep-master/build/jsb-default/frameworks/runtime-src/proj.android’
C:/Users/Rhodier/AppData/Local/Android/android-ndk-r10b/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
Building mode: debug
Using Eclipse project : C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android
Android platform not specified, searching a default one

running: ‘“C:\Users\Rhodier\AppData\Local\Android\sdk\tools\android” update project -t android-23 -p C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android’

Android platform not specified, searching a default one

running: ‘“C:\Users\Rhodier\AppData\Local\Android\sdk\tools\android” update lib-project -p C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\cocos2d-x\cocos\platform\android\java -t android-23’

Building native

NDK build mode: debug
NDK_TOOLCHAIN_VERSION: 4.8
running: ‘“C:\Users\Rhodier\AppData\Local\Android\android-ndk-r10b\ndk-build” -C C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android -j4 NDK_MODULE_PATH=C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android
/
/cocos2d-x;C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android
/
/cocos2d-x/cocos;C:\Users\Rhodier\Documents\tutorial-duang-sheep-master\build\jsb-default\frameworks\runtime-src\proj.android
/
/cocos2d-x/external NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1’

Error running command, return code: 2.

@minpik seems that there is some problem with your ndk and project setting.

I suggest you create a new project and and try building it and if this error remains try ndk 10c or 9b

@Undercode thx for you answers but it’s the same again.

@Minpik did you change NDK to 10c or 10b??

@Undercode 10c, 10b and 9b

@Minpik do you try to build a empty project

@Undercode yes a empty project

@minpik can u please give a try to NDK 9d it is quite compatible with arm devices

Seems your sdk path using during compilation doesn’t correspond the one you set in your preference,

  • Used in compilation: C:\Users\Rhodier\AppData\Local\Android\sdk\tools\android
  • The one you set in preference: C:\Users\Rhodier\AppData\Local\Android\android-sdk

Please try to set a environment variable ANDROID_SDK_ROOT for it

Hello,

I don’t know where I can create a new post (maybe as a new user I am not allowed to do it) so I use this topic in order to explain my issue which is also due to android compilation.

The issue is my user folder contains special character “SĂ©bastien” and when I compile, here is the issue:

File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\bin/cocos.py”, line 947, in
run_plugin(command, argv, plugins)
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\bin/cocos.py”, line 857, in run_plugin
plugin.run(argv, dependencies_objects)
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py”, line 258, in run
self.parse_args(argv)
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py”, line 162, in parse_args
self.init(args)
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py”, line 54, in init
self._templates_paths = self.get_templates_paths()
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\bin\cocos.py”, line 434, in get_templates_paths
path = cls.get_cocos2d_path()
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\bin\cocos.py”, line 397, in get_cocos2d_path
path = cls.get_console_path()
File “C:\Users\SĂ©bastien\AppData\Local\CocosCreator\app-1.0.3\resources\cocos2d-x\tools\cocos2d-console\bin\cocos.py”, line 413, in get_console_path
run_path = unicode(get_current_path(), “utf-8”)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xe9 in position 10: invalid continuation byte

Is it possible to fix it ? I don’t want to change my app folder name (linked to my microsoft account, and I have already lot of data and scared that if I changed the folder name other apps may not work)

Thanks.

thank you so much.

I use android ndk r13. Had some Components of Android SDK not installed, Just made some hard work and made it to compile. Cocos Compiles to Android like a charm
 Need any help? Just paste last few lines of log which meant error, I’ll might help you out
 Cheers.

Hi
I have problem with compile as well. I am new and dont know how to start a new thread.
Building mode: release
Using Android Studio project : C:\Users\muthu_000\Documents\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio
Skipping task ‘:libcocos2dx:mergeReleaseResources’ as it is up-to-date (took 0.024 secs).
:libcocos2dx:mergeReleaseResources UP-TO-DATE
:libcocos2dx:mergeReleaseResources (Thread[Daemon worker Thread 6,5,main]) completed. Took 0.026 secs.
:libcocos2dx:verifyReleaseResources (Thread[Task worker for ‘:’ Thread 3,5,main]) started.
:libcocos2dx:verifyReleaseResources
Putting task artifact state for task ‘:libcocos2dx:verifyReleaseResources’ into context took 0.0 secs.
Executing task ‘:libcocos2dx:verifyReleaseResources’ (up-to-date check took 0.003 secs) due to:
Input property ‘manifestFiles’ file C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml has changed.
Aapt2QueuedResourceProcessor is using C:\Users\muthu_000\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe

AAPT2 processed(84628651) AndroidManifest.xml job:QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}
AAPT1 err(Facade for 84628651): error: invalid file path ‘C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’. -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}
AAPT warning(2085130276), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}): error: invalid file path ‘C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’.
AAPT1 err(Facade for 84628651): Error -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}
AAPT warning(2085130276), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}): Error
AAPT1 err(Facade for 84628651): Done -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}
error: invalid file path ‘C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’.

AAPT warning(2085130276), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a}): Done
Exception while processing job : QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\Users\muthu_000\Documents\Development\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@bccaa7a} : com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
:libcocos2dx:verifyReleaseResources FAILED
:libcocos2dx:verifyReleaseResources (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 0.028 secs.
AAPT1 err(Facade for 1612991259): W/ResourceType( 200): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1238) -> QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}
AAPT warning(1063675990), Job(QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}): W/ResourceType( 200): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1238)
AAPT1 err(Facade for 1612991259): W/ResourceType( 200): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1238) -> QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}
AAPT warning(1063675990), Job(QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}): W/ResourceType( 200): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1238)
AAPT1 err(Facade for 1612991259): W/ResourceType( 200): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1238) -> QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}
AAPT warning(1063675990), Job(QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}): W/ResourceType( 200): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1238)
AAPT1 err(Facade for 1612991259): W/ResourceType( 200): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1238) -> QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}
AAPT warning(1063675990), Job(QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}): W/ResourceType( 200): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1238)
AAPT1 err(Facade for 1612991259): Done -> QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}
AAPT warning(1063675990), Job(QueuedJob{
title=Linking,
task={config=com.android.builder.internal.aapt.AaptPackageConfig@6ee3b96f},
future=com.google.common.util.concurrent.SettableFuture@6adc206b}): Done
Aapt output file C:\Users\muthu_000\Documents\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\res\release\resources-release.ap_
Process (1612991259) processed 1 files
Thread(queued-resource-processor_20): Process(1612991259), after shutdown queue_size=3
Process (84628651) processed 1 files
Thread(queued-resource-processor_17): Process(84628651), after shutdown queue_size=2
Process (355113156) processed 0 files
Thread(queued-resource-processor_19): Process(355113156), after shutdown queue_size=1
Process (1001184786) processed 0 files
Thread(queued-resource-processor_18): Process(1001184786), after shutdown queue_size=0
Shutdown finished in 13ms
:NewProject:processReleaseResources (Thread[Task worker for ‘:’ Thread 2,5,main]) completed. Took 0.437 secs.

FAILURE: Build failed with an exception.

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

java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

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

BUILD FAILED in 1s
44 actionable tasks: 3 executed, 41 up-to-date
Error running command, return code: 1.

PLEASE HELP!!! Deleted some part of log for post size

Hey there,
having a bit of an issue too with compiling. Here is the error code, it doesn’t make much sense to me haha. If anyone knows what could fix it, I’d be super grateful. Thanks for taking a look

Error: Compile failed. The log file path [ /Users/vazronix/.CocosCreator/logs/native.log ]
at ChildProcess.handleChildProcess (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/native-utils.js:1:20297)
at ChildProcess.e.on (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/native-utils.js:1:7685)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12)