首先,我为英语缺乏经验的部分道歉。我是一名初学者,这次尝试使用 Cocos Creator 开发 Android 应用。我测试了一下,但是一开始我是用Android搭建的,编译的很好,但是安装SDKBOX并导入AdMob后就可以编译了,但是编译还是继续失败,于是查看了Native.log,带来了失败的部分,但是我看了日志也不知道是什么原因 Build with Android 是我第一次,Cocos 本身,所以有很多困难的部分,但是我能指点一下哪个部分有问题吗?我正在使用 MacOs,并且我使用过 ndk 17
> Task :game:compileReleaseJavaWithJavac FAILED
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/src/main/java', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/libs', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/libs', not found
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/okhttp-3.12.7.jar
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/okio-1.15.0.jar
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact instantapps.aar (com.google.android.instantapps:instantapps:1.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-instantapps.aar (com.google.android.gms:play-services-instantapps:16.0.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-base.aar (com.google.android.gms:play-services-base:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-v4.aar (com.android.support:support-v4:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-media-compat.aar (com.android.support:support-media-compat:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-fragment.aar (com.android.support:support-fragment:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-core-utils.aar (com.android.support:support-core-utils:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-core-ui.aar (com.android.support:support-core-ui:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-compat.aar (com.android.support:support-compat:26.1.0)
Executing transform IdentityTransform -> IdentityTransform on artifact support-annotations.jar (com.android.support:support-annotations:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact runtime.aar (android.arch.lifecycle:runtime:1.0.0)
Executing transform IdentityTransform -> IdentityTransform on artifact common.jar (android.arch.lifecycle:common:1.0.0)
Executing transform IdentityTransform -> IdentityTransform on artifact common.jar (android.arch.core:common:1.0.0)
Task ':game:compileReleaseJavaWithJavac' is not up-to-date because:
Input property 'source' file /Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/arch/lifecycle/R 2.java has been added.
Input property 'source' file /Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/compat/R 2.java has been added.
Input property 'source' file /Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/coreui/R 2.java has been added.
Compiling with source level 1.7 and target level 1.7.
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/libs', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/libs', not found
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/okhttp-3.12.7.jar
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/com.android.vending.expansion.zipfile.jar
Executing transform IdentityTransform -> IdentityTransform on file /Applications/CocosCreator/Creator/2.4.4/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs/okio-1.15.0.jar
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact instantapps.aar (com.google.android.instantapps:instantapps:1.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-instantapps.aar (com.google.android.gms:play-services-instantapps:16.0.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-base.aar (com.google.android.gms:play-services-base:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-v4.aar (com.android.support:support-v4:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-media-compat.aar (com.android.support:support-media-compat:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-fragment.aar (com.android.support:support-fragment:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-core-utils.aar (com.android.support:support-core-utils:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-core-ui.aar (com.android.support:support-core-ui:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact support-compat.aar (com.android.support:support-compat:26.1.0)
Executing transform IdentityTransform -> IdentityTransform on artifact support-annotations.jar (com.android.support:support-annotations:26.1.0)
Executing transform IdentityTransform -> ExtractAarTransform -> AarTransform on artifact runtime.aar (android.arch.lifecycle:runtime:1.0.0)
Executing transform IdentityTransform -> IdentityTransform on artifact common.jar (android.arch.lifecycle:common:1.0.0)
Executing transform IdentityTransform -> IdentityTransform on artifact common.jar (android.arch.core:common:1.0.0)
Created classpath snapshot for incremental compilation in 0.001 secs.
Class dependency analysis for incremental compilation took 0.005 secs.
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/src/main/java', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/src/release/java', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/source/aidl/release', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/src/main/java', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/src/release/java', not found
file or directory '/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/source/aidl/release', not found
Compiling with JDK Java compiler API.
Incremental compilation of 14 classes completed in 0.062 secs.
:game:compileReleaseJavaWithJavac (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 0.08 secs.
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/org/cocos2dx/lib/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/org/cocos2dx/javascript/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/coreutils/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/compat/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/coreui/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/v4/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/fragment/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/support/mediacompat/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/android/arch/lifecycle/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/google/android/gms/tasks/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/google/android/gms/common/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/google/android/gms/instantapps/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/google/android/gms/base/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
/Users/onue/Documents/Dev/Game/Cococs/AdMobTest/build/jsb-link/frameworks/runtime-src/proj.android-studio/game/build/generated/not_namespaced_r_class_sources/release/generateReleaseRFile/out/com/google/android/instantapps/R 2.java:9: error: class R is public, should be declared in a file named R.java
public final class R {
^
14 errors
3 warnings
</p>