到底creator 2.4.13要用多少版本的AndroidStudio、sdk、ndk啊,创建完直接构建然后编译失败
目前我这边 这个配置是正常出包的
NDK /Users/myuser/Library/Android/sdk/ndk/21.4.7075529
Android SDK /Users/myuser/Library/Android/sdk
如果是 苹果Mac电脑的 M芯片 记得 要修改
arch -x86_64 /bin/bash DIR/build/ndk-build "@"
我本地测试过 NDK 25 就不需要修改关于M2 的修改
其他关于 Gradle 和 Gradle 插件的相关知识
https://developer.android.com/build/releases/gradle-plugin?hl=zh-cn
你好,我用的是AndroidStudio2024.1、JDK11、NDK 22
SDK是33
Building mode: release
Using Android Studio project : D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio
Building apk…
running: ‘“D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\gradlew.bat” --parallel --info assembleRelease’
Initialized native services in: C:\Users\dengq.gradle\native
Initialized jansi services in: C:\Users\dengq.gradle\native
Received JVM installation metadata from ‘C:\Program Files\Java\jdk-11’: {JAVA_HOME=C:\Program Files\Java\jdk-11, JAVA_VERSION=11.0.23, JAVA_VENDOR=Oracle Corporation, RUNTIME_NAME=Java™ SE Runtime Environment, RUNTIME_VERSION=11.0.23+7-LTS-222, VM_NAME=Java HotSpot™ 64-Bit Server VM, VM_VERSION=11.0.23+7-LTS-222, VM_VENDOR=Oracle Corporation, OS_ARCH=amd64}
Found daemon DaemonInfo{pid=24068, address=[baed1fdf-6cde-400a-9893-beb40932474c port:58019, addresses:[/127.0.0.1]], state=Idle, lastBusy=1721539978895, context=DefaultDaemonContext[uid=1816978c-ce84-498d-a2b6-74bf7bdf0721,javaHome=C:\Program Files\Android\Android Studio1\jbr,daemonRegistryDir=C:\Users\dengq.gradle\daemon,pid=24068,idleTimeout=10800000,priority=NORMAL,daemonOpts=–add-opens=java.base/java.util=ALL-UNNAMED,–add-opens=java.base/java.lang=ALL-UNNAMED,–add-opens=java.base/java.lang.invoke=ALL-UNNAMED,–add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,–add-opens=java.base/java.nio.charset=ALL-UNNAMED,–add-opens=java.base/java.net=ALL-UNNAMED,–add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-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\jdk-11,daemonRegistryDir=C:\Users\dengq.gradle\daemon,pid=22396,idleTimeout=null,priority=NORMAL,daemonOpts=–add-opens=java.base/java.util=ALL-UNNAMED,–add-opens=java.base/java.lang=ALL-UNNAMED,–add-opens=java.base/java.lang.invoke=ALL-UNNAMED,–add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,–add-opens=java.base/java.nio.charset=ALL-UNNAMED,–add-opens=java.base/java.net=ALL-UNNAMED,–add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]
Actual: DefaultDaemonContext[uid=1816978c-ce84-498d-a2b6-74bf7bdf0721,javaHome=C:\Program Files\Android\Android Studio1\jbr,daemonRegistryDir=C:\Users\dengq.gradle\daemon,pid=24068,idleTimeout=10800000,priority=NORMAL,daemonOpts=–add-opens=java.base/java.util=ALL-UNNAMED,–add-opens=java.base/java.lang=ALL-UNNAMED,–add-opens=java.base/java.lang.invoke=ALL-UNNAMED,–add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,–add-opens=java.base/java.nio.charset=ALL-UNNAMED,–add-opens=java.base/java.net=ALL-UNNAMED,–add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-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: 23540). The daemon log file: C:\Users\dengq.gradle\daemon\8.0.2\daemon-23540.out.log
Starting 4th build in daemon [uptime: 1 hrs 49 mins 33.677 secs, performance: 99%, GC rate: 0.00/s, heap usage: 0% of 512 MiB, non-heap usage: 13% of 384 MiB]
Using 32 worker leases.
Now considering [D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file ‘D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\settings.gradle’.
Projects loaded. Root project using build file ‘D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\build.gradle’.
Included projects: [root project ‘proj.android-studio’, project ‘:hello_world’, project ‘:instantapp’, project ‘:libcocos2dx’]
Configure project :
Evaluating root project ‘proj.android-studio’ using build file ‘D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\build.gradle’.
The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
Configure project :hello_world
Evaluating project ‘:hello_world’ using build file ‘D:\NewProject\build\jsb-default\frameworks\runtime-src\proj.android-studio\app\build.gradle’.
FAILURE: Build failed with an exception.
-
Where:
Build file ‘D:\NewProject\build\jsb-default\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 ‘com.android.internal.application’.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in C:\Program Files\Java\jdk-11
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changingorg.gradle.java.home
ingradle.properties
.
- 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 1sWatched directory hierarchies: []
Error running command, return code: 1.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
OK啦,确实是版本的问题,试了好多个版本碰对了,谢谢回复哈
哥们 你插件和gradle版本用的多少啊当时