Android Question [solved] Admob Integration error

Discussion in 'Android Questions' started by Rajesh kannan MJ, May 1, 2015.

  1. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    Hi,

    UPDATE : The following issue is resolved. The recent version of Google Play Services seems requiring more memory while compiling. So, I set the MaxRamForDex to 1500 in b4aV0.1.ini file.

    My version is 4.00

    Admob version is 2.00

    The google-play-services.jar file size is 4492kb(just thought I can share)

    Downloaded the recent version of google-play-services.jar. Added in manifest and header of project too.

    But I am getting this error when the app starts,


    admob.png

    Can any one or @Erel Can you please help on it?
     
    Last edited: May 3, 2015
  2. walterf25

    walterf25 Well-Known Member Licensed User

    did you copy the latest google_play_srevices.jar file into your additional libraries folder?
    did you add the resources folder to your project and added this to your project?
    Code:
    #AdditionalRes: C:\android-sdk-windows\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
    Cheers,
    Walter
     
    NJDude likes this.
  3. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    @walterf25 Yes, I did that,

    Copied the latest google_play_services.jar to the additional libraries folder.

    Added resource with #additionalRes: line.

    I am facing another issue too. It takes abnormal time to compile. Sometimes 2 minutes and crashes. Also it says, switching to another compiler or something like that.

    Thank you,
     
  4. NJDude

    NJDude Expert Licensed User

    If you copied the latest JAR do not forget to REFRESH the libraries in the IDE; regarding the long time to compile, using AdMod will cause that since that's a beefy library.
     
  5. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    @NJDude ok I will do that and reply the feedback here.

    But Before that, I have even restarted B4A often, does not that count?

    Anyways, I will refresh and get you back here,

    Thank you,
     
  6. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    Code:
    Parsing code.                           0.01
    Compiling code.                         
    0.33
    Compiling layouts code.                 
    0.01
    Generating R 
    file.                      1.19
    Compiling generated Java code.          
    4.90
    Convert byte code - optimized dex.      Error
    UNEXPECTED TOP-LEVEL ERROR:
    java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.lang.StringBuilder.toString(
    StringBuilder.java:407)
        at com.android.dx.rop.type.Prototype.withFirstParameter(Prototype.java:
    370)
        at com.android.dx.rop.code.Rops.ropFor(Rops.java:
    1210)
        at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:
    490)
        at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:
    691)
        at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:
    764)
        at com.android.dx.cf.code.Simulator.simulate(Simulator.java:
    94)
        at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:
    787)
        at com.android.dx.cf.code.Ropper.doit(Ropper.java:
    742)
        at com.android.dx.cf.code.Ropper.convert(Ropper.java:
    349)
        at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:
    280)
        at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:
    137)
        at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:
    93)
        at com.android.dx.command.dexer.Main.processClass(Main.java:
    729)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
    673)
        at com.android.dx.command.dexer.Main.access$
    300(Main.java:83)
        at com.android.dx.command.dexer.Main$
    1.processFileBytes(Main.java:602)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:
    284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:
    166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
    144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:
    632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    280)
        at com.android.dx.command.dexer.Main.run(Main.java:
    246)
        at com.android.dx.command.dexer.Main.main(Main.java:
    215)
        at com.android.dx.command.Main.main(Main.java:
    106)
        Optimized dexer failed. Switching 
    to Standard dexer.
    This is what is shown in the compiler box now,
     
  7. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    @Erel Can you please help on it?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

  9. Rajesh kannan MJ

    Rajesh kannan MJ Member Licensed User

    @Erel Thanks. It is now solved.

    I set the RAM level to 1500 in the b4aV0.1.ini

    The file generally resides at C:\Users\<user name>\AppData\Roaming\Anywhere Software\Basic4android\b4aV0.1.ini

    by setting MaxRamForDex to 1500

    BTW , Erel, When the B4A is open and if I edit the ini file and add the value, it does not get stored. I mean actually it seems B4A keeps the old ini in RAM or somewhere and while closing it rewrites the INI with the RAM stored values. It is just for you.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    This is the expected behavior. B4A writes the ini file when it is closed. It doesn't monitor the file for changes.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice