windows 下cocos creator 2.0.9 android helloworld 无法编译通过

cocos creator 2.0.9
NDK r19
sdk 25
androidstudio 可以编译生成APK
通过 creator 项目->构建发布,无法编译通过,报如下错误

Configure project :hello_world
Evaluating project ‘:hello_world’ using build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build.gradle’.
Creating configuration androidTestUtil

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build.gradle’ line: 3

  • What went wrong:
    A problem occurred evaluating project ‘:hello_world’.

Failed to apply plugin [id ‘com.android.application’]
Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension_Decorated.
Could not create an instance of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.
Uninitialized object exists on backward branch 70
Exception Details:
Location:
com/android/build/gradle/internal/scope/BuildArtifactsHolder.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/internal/scope/BuildArtifactsHolder$BuildableArtifactData; @119: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb02 0559 2bb9 0208 0100 c000 b82b b902
0000010: 0c01 0001 b902 1202 0059 1302 14b8 0051
0000020: c001 734d 3a0d 3a0c 3a0b 2c4e bb01 a659
0000030: 2c10 0ab8 0177 b701 a7c0 00b8 3a04 2db9
0000040: 018e 0100 3a05 1905 b901 9401 0099 002d
0000050: 1905 b901 9801 003a 0619 0419 06c0 00f1
0000060: 3a07 3a0e 1907 b902 1501 003a 0f19 0e19
0000070: 0fb9 01ad 0200 57a7 ffcf 1904 c001 af3a
0000080: 0e19 0b19 0c19 0d19 0eb7 0218 b0
Stackmap Table:
full_frame(@70,{Object[#2],Object[#83],Object[#371],Object[#371],Object[#184],Object[#400],Top,Top,Top,Top,Top,Uninitialized[#0],Uninitialized[#0],Object[#184]},{})
same_frame(@122)

  • 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

编译模式:release
使用 Android Studio 工程:D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio
正在生成 apk 文件…
正在执行:’“D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\gradlew.bat” --parallel --info assembleRelease’

Initialized native services in: C:\Users\guopf01.gradle\native
Found daemon DaemonInfo{pid=3392, address=[71e2cad1-5f87-448b-8c8c-eb9c9f2847f8 port:57340, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1558865227023, context=DefaultDaemonContext[uid=cc6185e8-f7a3-4a07-929b-e7a5dcda9cc0,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\guopf01.gradle\daemon,pid=3392,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]} however its context does not match the desired criteria.
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jdk1.8.0_05,daemonRegistryDir=C:\Users\guopf01.gradle\daemon,pid=1180,idleTimeout=null,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]
Actual: DefaultDaemonContext[uid=cc6185e8-f7a3-4a07-929b-e7a5dcda9cc0,javaHome=C:\Program Files\Android\Android Studio\jre,daemonRegistryDir=C:\Users\guopf01.gradle\daemon,pid=3392,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]

Looking for a different daemon…
The client will now receive all logging from the daemon (pid: 6908). The daemon log file: C:\Users\guopf01.gradle\daemon\4.10.3\daemon-6908.out.log
Starting 2nd build in daemon [uptime: 6 mins 44.708 secs, performance: 94%, no major garbage collections]
Using 4 worker leases.
Invalidating in-memory cache of D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.10.3\fileHashes\fileHashes.bin
Starting Build
Invalidating in-memory cache of C:\Users\guopf01.gradle\caches\4.10.3\fileHashes\fileHashes.bin
Invalidating in-memory cache of C:\Users\guopf01.gradle\caches\4.10.3\fileHashes\resourceHashesCache.bin
Settings evaluated using settings file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\settings.gradle’.
Projects loaded. Root project using build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\build.gradle’.
Included projects: [root project ‘proj.android-studio’, project ‘:hello_world’, project ‘:libcocos2dx’]
Parallel execution is an incubating feature.

Configure project :
Evaluating root project ‘proj.android-studio’ using build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\build.gradle’.
Invalidating in-memory cache of C:\Users\guopf01.gradle\caches\journal-1\file-access.bin

Configure project :hello_world
Evaluating project ‘:hello_world’ using build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build.gradle’.
Creating configuration androidTestUtil

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘D:\project\app\web\NewProject\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build.gradle’ line: 3

  • What went wrong:
    A problem occurred evaluating project ‘:hello_world’.

Failed to apply plugin [id ‘com.android.application’]
Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension_Decorated.
Could not create an instance of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.
Uninitialized object exists on backward branch 70
Exception Details:
Location:
com/android/build/gradle/internal/scope/BuildArtifactsHolder.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/internal/scope/BuildArtifactsHolder$BuildableArtifactData; @119: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb02 0559 2bb9 0208 0100 c000 b82b b902
0000010: 0c01 0001 b902 1202 0059 1302 14b8 0051
0000020: c001 734d 3a0d 3a0c 3a0b 2c4e bb01 a659
0000030: 2c10 0ab8 0177 b701 a7c0 00b8 3a04 2db9
0000040: 018e 0100 3a05 1905 b901 9401 0099 002d
0000050: 1905 b901 9801 003a 0619 0419 06c0 00f1
0000060: 3a07 3a0e 1907 b902 1501 003a 0f19 0e19
0000070: 0fb9 01ad 0200 57a7 ffcf 1904 c001 af3a
0000080: 0e19 0b19 0c19 0d19 0eb7 0218 b0
Stackmap Table:
full_frame(@70,{Object[#2],Object[#83],Object[#371],Object[#371],Object[#184],Object[#400],Top,Top,Top,Top,Top,Uninitialized[#0],Uninitialized[#0],Object[#184]},{})
same_frame(@122)

  • 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
执行命令出错,返回值:1。

What went wrong:
A problem occurred evaluating project ‘:hello_world’.

Failed to apply plugin [id ‘com.android.application’]
Could not create an instance of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension_Decorated.
Could not create an instance of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.
Uninitialized object exists on backward branch 70
Exception Details:
Location:
com/android/build/gradle/internal/scope/BuildArtifactsHolder.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/internal/scope/BuildArtifactsHolder$BuildableArtifactData; @119: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: bb02 0559 2bb9 0208 0100 c000 b82b b902
0000010: 0c01 0001 b902 1202 0059 1302 14b8 0051
0000020: c001 734d 3a0d 3a0c 3a0b 2c4e bb01 a659
0000030: 2c10 0ab8 0177 b701 a7c0 00b8 3a04 2db9
0000040: 018e 0100 3a05 1905 b901 9401 0099 002d
0000050: 1905 b901 9801 003a 0619 0419 06c0 00f1
0000060: 3a07 3a0e 1907 b902 1501 003a 0f19 0e19
0000070: 0fb9 01ad 0200 57a7 ffcf 1904 c001 af3a
0000080: 0e19 0b19 0c19 0d19 0eb7 0218 b0
Stackmap Table:
full_frame(@70,{Object[#2],Object[#83],Object[#371],Object[#371],Object[#184],Object[#400],Top,Top,Top,Top,Top,Uninitialized[#0],Uninitialized[#0],Object[#184]},{})
same_frame(@122)