Build Error Using Android Studio : Execution failed for task ':libcocos2dx:verifyReleaseResources'

Build Error Using Android Studio : Execution failed for task ':libcocos2dx:verifyReleaseResources'
0.0 0

#1

Hi i downloaded duang sheep game, but cannot build it to android, here is the logs :

( The log is 72k characters, so i post to hastebin )

https://hastebin.com/ipebodiyew.sql

The very end of the log :

:libcocos2dx:verifyReleaseResources (Thread[Daemon worker,5,main]) started.
:libcocos2dx:verifyReleaseResources
Putting task artifact state for task ‘:libcocos2dx:verifyReleaseResources’ into context took 0.0 secs.
Process (31219950) processed 0 files
Thread(queued-resource-processor_10): Process(31219950), after shutdown queue_size=3
Process (19340082) processed 0 files
Thread(queued-resource-processor_9): Process(19340082), after shutdown queue_size=2
Process (7772906) processed 0 files
Thread(queued-resource-processor_11): Process(7772906), after shutdown queue_size=1
Process (14963356) processed 1 files
Thread(queued-resource-processor_12): Process(14963356), after shutdown queue_size=0
Shutdown finished in 7ms
Executing task ‘:libcocos2dx:verifyReleaseResources’ (up-to-date check took 0.006 secs) due to:
Input property ‘manifestFiles’ file C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml has changed.
Aapt2QueuedResourceProcessor is using E:\AndroidSDK\build-tools\26.0.2\aapt2.exe

Trying to start E:\AndroidSDK\build-tools\26.0.2\aapt2.exe
Trying to start E:\AndroidSDK\build-tools\26.0.2\aapt2.exe
Trying to start E:\AndroidSDK\build-tools\26.0.2\aapt2.exe
Trying to start E:\AndroidSDK\build-tools\26.0.2\aapt2.exe
:SheepJump:processReleaseResources (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 0.182 secs.
:SheepJump:generateReleaseSources (Thread[Task worker for ‘:’ Thread 3,5,main]) started.
:SheepJump:generateReleaseSources
Skipping task ‘:SheepJump:generateReleaseSources’ as it has no actions.
:SheepJump:generateReleaseSources (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 0.001 secs.
:SheepJump:javaPreCompileRelease (Thread[Task worker for ‘:’ Thread 3,5,main]) started.
:SheepJump:javaPreCompileRelease
Putting task artifact state for task ‘:SheepJump:javaPreCompileRelease’ into context took 0.0 secs.
file or directory ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
Skipping task ‘:SheepJump:javaPreCompileRelease’ as it is up-to-date (took 0.002 secs).
:SheepJump:javaPreCompileRelease UP-TO-DATE
:SheepJump:javaPreCompileRelease (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 0.003 secs.
:SheepJump:compileReleaseJavaWithJavac (Thread[Task worker for ‘:’ Thread 3,5,main]) started.
:SheepJump:compileReleaseJavaWithJavac
Putting task artifact state for task ‘:SheepJump:compileReleaseJavaWithJavac’ into context took 0.0 secs.
file or directory ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\src\main\java’, not found
file or directory ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\libs’, not found
file or directory ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\src\main\java’, not found
file or directory ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\src\release\java’, not found
Skipping task ‘:SheepJump:compileReleaseJavaWithJavac’ as it is up-to-date (took 0.006 secs).
:SheepJump:compileReleaseJavaWithJavac UP-TO-DATE
:SheepJump:compileReleaseJavaWithJavac (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 0.008 secs.
:SheepJump:generateJsonModelRelease (Thread[Task worker for ‘:’ Thread 3,5,main]) started.
:SheepJump:generateJsonModelRelease
Putting task artifact state for task ‘:SheepJump:generateJsonModelRelease’ into context took 0.0 secs.
Executing task ‘:SheepJump:generateJsonModelRelease’ (up-to-date check took 0.0 secs) due to:
Value of input property ‘externalNativeJsonGenerator.buildArguments’ has changed for task ‘:SheepJump:generateJsonModelRelease’
External native generate JSON release: starting JSON generation
External native generate JSON release: bringing JSONs up-to-date
External native generate JSON release: using platform version 14 for ABI ARMEABI_V7A and min SDK version 10
Started 13016269
error: invalid file path ‘C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’.

Slave 13016269 is ready
AAPT2 processed(13016269) AndroidManifest.xml job:QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}
Started 14049052
AAPT1 err(Facade for 13016269): error: invalid file path ‘C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’. -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}
AAPT warning(26980901), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}): error: invalid file path ‘C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml’.
AAPT1 err(Facade for 13016269): Error -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}
AAPT warning(26980901), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}): Error
AAPT1 err(Facade for 13016269): Done -> QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}
AAPT warning(26980901), Job(QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5}): Done
Exception while processing job : QueuedJob{
title=Compiling AndroidManifest.xml,
task={from=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\manifests\aapt\release\AndroidManifest.xml, to=C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build\intermediates\res\compiled\release},
future=com.google.common.util.concurrent.SettableFuture@17ae5} : com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Process (13016269) processed 1 files
Thread(queued-resource-processor_13): Process(13016269), after shutdown queue_size=0
External native generate JSON release: rebuilding JSON E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\ndkBuild\release\armeabi-v7a\android_gradle_build.json due to:
External native generate JSON release: - command changed from previous
External native generate JSON release: removing stale contents from ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\ndkBuild\release\armeabi-v7a’
Slave 14049052 is ready
Process (14049052) processed 0 files
Thread(queued-resource-processor_15): Process(14049052), after shutdown queue_size=0
External native generate JSON release: created folder ‘E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\ndkBuild\release\armeabi-v7a’
External native generate JSON release: executing ndkBuild Executable : E:\AndroidSDK\ndk-bundle\ndk-build.cmd
arguments :
NDK_PROJECT_PATH=null
APP_BUILD_SCRIPT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk
NDK_APPLICATION_MK=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk
APP_ABI=armeabi-v7a
NDK_ALL_ABIS=armeabi-v7a
NDK_DEBUG=0
APP_PLATFORM=android-14
NDK_OUT=E:/Cocos/Project/tutorial-duang-sheep-master/tutorial-duang-sheep-master/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj
NDK_LIBS_OUT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib
NDK_TOOLCHAIN_VERSION=4.9
APP_PLATFORM=android-17
NDK_MODULE_PATH=C:\CocosCreator\resources\cocos2d-x;C:\CocosCreator\resources\cocos2d-x\cocos;C:\CocosCreator\resources\cocos2d-x\external
-j4
NDK_DEBUG=0
APP_SHORT_COMMANDS=false
LOCAL_SHORT_COMMANDS=false
-B
-n
jvmArgs :

Executable : E:\AndroidSDK\ndk-bundle\ndk-build.cmd
arguments :
NDK_PROJECT_PATH=null
APP_BUILD_SCRIPT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk
NDK_APPLICATION_MK=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk
APP_ABI=armeabi-v7a
NDK_ALL_ABIS=armeabi-v7a
NDK_DEBUG=0
APP_PLATFORM=android-14
NDK_OUT=E:/Cocos/Project/tutorial-duang-sheep-master/tutorial-duang-sheep-master/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj
NDK_LIBS_OUT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib
NDK_TOOLCHAIN_VERSION=4.9
APP_PLATFORM=android-17
NDK_MODULE_PATH=C:\CocosCreator\resources\cocos2d-x;C:\CocosCreator\resources\cocos2d-x\cocos;C:\CocosCreator\resources\cocos2d-x\external
-j4
NDK_DEBUG=0
APP_SHORT_COMMANDS=false
LOCAL_SHORT_COMMANDS=false
-B
-n
jvmArgs :

Starting process ‘command ‘E:\AndroidSDK\ndk-bundle\ndk-build.cmd’’. Working directory: E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app Command: E:\AndroidSDK\ndk-bundle\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=E:/Cocos/Project/tutorial-duang-sheep-master/tutorial-duang-sheep-master/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-17 NDK_MODULE_PATH=C:\CocosCreator\resources\cocos2d-x;C:\CocosCreator\resources\cocos2d-x\cocos;C:\CocosCreator\resources\cocos2d-x\external -j4 NDK_DEBUG=0 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n
Started 17001562
Slave 17001562 is ready
Process (17001562) processed 0 files
Thread(queued-resource-processor_16): Process(17001562), after shutdown queue_size=0
Started 22845200
Successfully started process ‘command ‘E:\AndroidSDK\ndk-bundle\ndk-build.cmd’’
Slave 22845200 is ready
Process (22845200) processed 0 files
Thread(queued-resource-processor_14): Process(22845200), after shutdown queue_size=0
Shutdown finished in 55ms
:libcocos2dx:verifyReleaseResources FAILED
:libcocos2dx:verifyReleaseResources (Thread[Daemon worker,5,main]) completed. Took 0.122 secs.
process_begin: CreateProcess(NULL, “”, …) failed.
External native generate JSON release: done executing ndkBuild
External native generate JSON release: write build output E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\ndkBuild\release\armeabi-v7a\ndkBuild_build_output.txt
External native generate JSON release: parse and convert ndk-build output to build configuration JSON
External native generate JSON release: found application make file E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk
External native generate JSON release: write command file E:\Cocos\Project\tutorial-duang-sheep-master\tutorial-duang-sheep-master\build\jsb-link\frameworks\runtime-src\proj.android-studio\app.externalNativeBuild\ndkBuild\release\armeabi-v7a\ndkBuild_build_command.txt
External native generate JSON release: build complete
External native generate JSON release: build completed without problems
:SheepJump:generateJsonModelRelease (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 4.677 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.

  • Get more help at https://help.gradle.org
    47 actionable tasks: 9 executed, 38 up-to-date

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


#2

hi man ,
i guess you updated the gradle for the project , there may be some problems with gradle 3.0

try this :

check out this

Aapt2 is enabled by default when you use android plugin for gradle 3.0.

This is to improve incremental resource processing
But if you are facing issues with it, you can switch back to previous version by adding this in gradle.properties

android.enableAapt2=false


#3

HI i tried modify the file gradle.properties in
jsb-link\frameworks\runtime-src\proj.android-studio

folder, like this :

PROP_TARGET_SDK_VERSION=17
PROP_APP_ABI=armeabi-v7a

RELEASE_STORE_FILE=C:/CocosCreator/resources/static/build-templates/native/debug.keystore
RELEASE_STORE_PASSWORD=123456
RELEASE_KEY_ALIAS=debug_keystore
RELEASE_KEY_PASSWORD=123456
android.enableAapt2=false

but it is still error :

https://hastebin.com/wopohalijo.sql

By the way, did i have to roll back to gradle 2.0 ? How to do that, what is your system software version recommended?


#4

i guess if you make the project in cocos creator and compile it again , it works , i don’t know really.

i’m using window 10 with cocos creator 1.7 and android studio 3.0.1


#5

It not work :frowning:

In native build log in cocos creator it say :slight_smile:
Execution failed for task ':duangsheep:externalNativeBuildRelease'.

While build via android studio it say

Error:(16, 1) fatal error: opening dependency file E:/Cocos/Project/tutorial-duang-sheep-master/tutorial-duang-sheep-master/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/cis/__/external/sources/Box2D/b2ObjectDestroyNotifier.o.d: No such file or directory


#6

i just downloaded the project from github , i will test it and give the result man


#7

just built the project with cocos creator and it’s working , what is your ndk version?

and one more question , did you setup the Native Develop section of preferences?

i’m using ndk-r13b.


#8

I build for android 4.2 ( api 17 )

I use NDK 16.1.4479499, i will try NDK 13 now

Yeah, i did setup the native develop section of preferences in cocos creator with those setting :slight_smile:
Use Builtin JavaScript Engine : Check
JavaScript Engine Path : Blank
Use Builtin Cocos2d-x Engine : Check
Cocos2d-x Engine Path : Blank
NDK Root : E:\AndroidSDK\ndk-bundle
Android SDK Root : E:\AndroidSDK
ANT Path : E:\Cocos\SDK\apache-ant-1.10.1-bin\ant\bin


#9

Tried NDK 13B, still :

Execution failed for task ':duangsheep:externalNativeBuildDebug'.


#10

Had This problem too.
Use this to help