[SOLVED] AdMob causing Android build to fail when compiling


#1

Hi,

My mobile application was building and compiling successfully when I had Flurry and Social Share SDK installed using the SDKBOX in Cocos Creator 1.4.2. After installing the AdMob plugin, my build works but compiling fails. I’ve been at this for days now and no luck.

Has anyone gotten their game to compile using the AdMob SDK/plugin?
What version of Android NDK, SDK, API Level and APP ABI did you use that worked for you?
@pabitrapadhy @nite

Here are my logs using:
Android NDK r10e
Android 22-sdk-macosx
API Level Android-24
APP ABI armeabi (checked)

Failed:

    /Applications/Cocos/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../
 In file included from jni/../../Classes/jsb_anysdk_basic_conversions.cpp:1:0:
/Applications/Cocos/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../
/cocos2d-x/external
/Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(VMFunctions.o) for Cortex-A8 erratum because it has no mapping
it has
jsb-default/frameworks/cocos2d-x/external/
 A8 erratum because it has no mapping symbols.
/Applications
Cocos
/Android/android-ndk-r10e/toolchains/arm-linux-
mapping
 symbols.
linux
Users/eliasfares/MobileGames/SimonSays/build
 /jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(Debugger.o) for Cortex-A8 erratum because it has no mapping symbols.
toolchains
/
arm-
linux-
androideabi
-4.9/prebuilt/darwin-x86_64/bin/../
scan executable section 161 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/
cocos2d-x/external/
android
/armeabi/libjs_static.a(Debugger.o
 ) for Cortex-A8 erratum because it has no mapping symbols.
../lib/gcc/arm-linux-androideabi/4.9/../../

Warnings:

./../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 7 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BytecodeCompiler.o) for Cortex-A8 erratum because it has no mapping symbols.
  prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 10 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BytecodeEmitter.o) for Cortex-A8 erratum because it has no mapping symbols.
 r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 22 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BytecodeEmitter.o) for Cortex-A8 erratum because it has no
  Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 1 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(FoldConstants.o) for Cortex-A8 erratum because it has no mapping symbols.
  cannot scan executable section 14 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RootMarking.o) for Cortex-A8 erratum because it has no mapping symbols.
 Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 42 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RegExpEngine.o) for
  it has no mapping symbols.
  warning: cannot scan executable section 9 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RegExpInterpreter.o) for Cortex-A8 erratum because it has no mapping symbols.
  /gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 67 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RegExpParser.o) for Cortex-A8 erratum because it has no mapping symbols.
  it has no mapping symbols.
  /arm-linux-androideabi/bin/ld: warning: cannot scan executable section 161 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RegExpParser.o) for Cortex-A8 erratum because it has no mapping symbols.
 /bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 163 of /Users/eliasfares/MobileGames/SimonSays/
  /lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 167 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(RegExpParser.o) for Cortex-A8 erratum because it has no mapping symbols.
  /cocos2d-x/external/android/armeabi/libjs_static.a(BaselineBailouts.o) for Cortex-A8 erratum because it has no mapping symbols.
  Cortex-A8 erratum because it has no mapping symbols.
  bin/ld: warning: cannot scan executable section 273 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BaselineIC.o) for Cortex-A8 erratum because it has no mapping symbols.
 /lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning:
  cannot scan executable section 401 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BaselineIC.o) for Cortex-A8 erratum because it has no mapping symbols.
 -linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 456 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(CodeGenerator.o) for Cortex
  it has no mapping symbols.
  lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: warning: cannot scan executable section 847 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(CodeGenerator.o) for Cortex-A8 erratum because it has no mapping symbols.
  scan executable section 875 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(CodeGenerator.o) for Cortex-A8 erratum because it has no mapping symbols.
  Cortex-A8 erratum because it has no mapping symbols.
 /arm-linux-androideabi/bin/ld: warning: cannot scan executable section 8 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BaselineIC-arm.o) for Cortex-A8 erratum because it has no
  symbols.
  because it has no mapping symbols.
../lib/gcc/arm-linux-androideabi/4.9/../../

Thanks!


#2

This warning message is fine, it just means that the lib don’t have debug symbols
Can you check it again and see if there is error or failed message?


#3

Sorry I thought I included the fail log. Here it is:

167 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android
/
 armeabi/libjs_static.a(RegExpParser.o) for Cortex-A8 erratum because it has no mapping symbols.
bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-
androideabi
Applications/Cocos/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt
 /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(BaselineIC.o) for Cortex-A8 erratum because it has no mapping symbols.
 823 of /Users/eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(CodeGenerator.o) for Cortex-A8 erratum because it has no mapping symbols.
eliasfares/MobileGames/SimonSays/build/jsb-default/frameworks/cocos2d-x/external/
 android/armeabi/libjs_static.a(EffectiveAddressAnalysis.o) for Cortex-A8 erratum because it has no mapping symbols.
 /jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(TaggedAnonymousMemory.o) for Cortex-A8 erratum because it has no mapping symbols.
cocos2d-x/external/android/armeabi/libjs_static.a(BaselineCompiler-shared.o) for Cortex-A8 erratum because it has no mapping symbols.
 BUILD FAILED
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:888: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:890: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:902: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:283: null returned: 2
Total time: 2 minutes 1 second
 Error: Compile failed. The log file path [ /Users/eliasfares/.CocosCreator/logs/native.log ]
at ChildProcess.<anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/native-utils.js:1:18737)
at ChildProcess.<anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/native-utils.js:1:7408)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

#4
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:888: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:890: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:902: The following error occurred while executing this line:
/Applications/Cocos/Android/android22-sdk-macosx/tools/ant/build.xml:283: null returned: 2

can you show diff with git diff after installing AdMob ??


#5

Do you want me to uninstall AdMob and then install it again?


#6

I tested Helloworld 1.4.2 with AdMob +flurryanalytics 2.3.13.5,

BUILD SUCCESSFUL
Total time: 33 seconds
Move apk to /Users/jryin/Documents/ccc/NewProject142/build/jsb-binary/simulator/android
Build succeed.
~/Documents/ccc/NewProject142/build/jsb-binary$

#7

That’s great! Can you tell me which versions of these did you use:
NDK? android-ndk-r13b
SDK? android22-sdk-macosx
API Level? android-25
APP ABI? armeabi

Much appreciated!


#8

android-ndk-r10d
android25.0.2-sdk-macosx
target=android-15
armeabi


#9

Thank you! Where did you download android25.0.2-sdk-macosx from? I can’t find it online.


#10

@nite @yinjimmy

It compiled successfully when building using binary template.
Also, I noticed that I don’t need to save my sdkbox_config.json file. It is not being overwritten and all my IDs are remaining saved even when I rebuild.

I’m seeing the test interstitial ad but the banner ad is not showing up. I’m using 0x0 smart banner but nothing is showing up. My project resolution is set to fit height.


#11

was the banner ready to show?


#12

I’m running AdMob in test mode, shouldn’t it always have a test ad to show?


#13

no, it depends AdMob.


#14

I am reading: https://developers.google.com/admob/android/banner#banner_sizes

And it says:

Note: If an app tries to load a banner that’s too big for its layout, the SDK won’t display it. Instead, an error message will be written to the log.

How do you go about dealing with space for the banner? Does the banner overlap the game layout? Do I have to add a widget with 50px space from the bottom (or top)?