Android Question Trying to use Appodeal SDK

Idan Arad

Member
Licensed User
Longtime User
Hi
I am Trying to integrate the appodeal SDK into my b4a application.
Whenever the app run , i get the following error

** Activity (main) Create, isFirst = true **


java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/GoogleApiAvailability;


at com.appodeal.ads.Appodeal.initialize(Unknown Source)
at com.appodeal.basic4android.AppodealB4A.initialize(AppodealB4A.java:39)
at com.TheFoodRadar.MegaFan.main._activity_create(main.java:354)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at com.TheFoodRadar.MegaFan.main.afterFirstLayout(main.java:100)
at com.TheFoodRadar.MegaFan.main.access$100(main.java:17)
at com.TheFoodRadar.MegaFan.main$WaitForLayout.run(main.java:78)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.GoogleApiAvailability" on path: DexPathList[[zip file "/data/app/com.TheFoodRadar.MegaFan-2/base.apk"],nativeLibraryDirectories=[/data/app/com.TheFoodRadar.MegaFan-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 15 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.GoogleApiAvailability
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 16 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available



I guess this error is google-play related
When i open the SDK manager i see that Google play services Rev 38 is installed , but I can not find the google-play-services.jar file under <sdk>\extras\google\google_play_services.

Any help would be appreciated.
Thanks,Idan
 

Idan Arad

Member
Licensed User
Longtime User
I tried , and got compilation error

B4A version 4.30
Parsing code. 0.01
Compiling code. 0.04
Using existing AndroidManifest.xml.
(Project - Do Not Overwrite Manifest option is checked)
AndroidManifest-Example.xml file will be created instead.
Compiling layouts code. 0.02
Generating R file. 0.13
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\com.android.support:support-v4.jar


When I copied the android-support-v4.jar file to the additinal libraries folder, and referenced it : #AdditionalJar: android-support-v4.jar
when trying to compile I get the following error


B4A version 4.30
Parsing code. 0.00
Compiling code. 0.04
Using existing AndroidManifest.xml.
(Project - Do Not Overwrite Manifest option is checked)
AndroidManifest-Example.xml file will be created instead.
Compiling layouts code. 0.00
Generating R file. 0.16
Compiling generated Java code. 1.47
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOf(Arrays.java:2219)
at java.util.ArrayList.grow(ArrayList.java:242)
at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:216)
at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:208)
at java.util.ArrayList.add(ArrayList.java:440)
at com.android.dx.ssa.Dominators.run(Dominators.java:213)
at com.android.dx.ssa.Dominators.make(Dominators.java:90)
at com.android.dx.ssa.DomFront.run(DomFront.java:86)
at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:297)
at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:51)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:98)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:303)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
at com.android.dx.command.dexer.Main.processClass(Main.java:682)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
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:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
Optimized dexer failed. Switching to Standard dexer.

I Already changed the MaxRamForOptimizedDex from 512MB to 2 GB. but still no go...
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
You have "old" version B4A 4.30. I dont think that with new SDK this will work.
So i think that you have two way:
1. Update Version B4A ( i recommend )
2. You read this #POST
 
Upvote 0

CSesma

Member
Licensed User
Longtime User
Idan, Have you been able to solve it?

I have the same problem, I have installed B4A 6 but nothing, I do not know how to follow.

Thanks in advance to any help
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
I can make it work, but i want to make it work with firebase services too, has anyone managed that?
 
Upvote 0

Idan Arad

Member
Licensed User
Longtime User
Idan, Have you been able to solve it?

I have the same problem, I have installed B4A 6 but nothing, I do not know how to follow.

Thanks in advance to any help
I installed b4a 6.5, but didn't have time to check it. After I will check I will post here.
 
Upvote 0

Idan Arad

Member
Licensed User
Longtime User
That's correct. You need to use B4A v6+ or downgrade to an older version of Google Play Services.
I upgrade B4A to 6.5 and also the latest versions of Java and Android SDK.
I download APPODEAL demo and run it .
I get the Following Error on compilation:

B4A version: 6.50
Parsing code. (0.00s)
Compiling code. (0.03s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.38s)
Compiling generated Java code. (1.36s)
Convert byte code - optimized dex. Error
Process timed out.
You can change the timeout value under Tools - IDE Options.


changing the timeout doesnt help.
I also tried to Change MaxRamForDex=512 to MaxRamForDex=1024 , but after I close and reopen B4A
it goes back to MaxRamForDex=512. (The filename is b4xv5.ini , and I also have b4aV0.1.ini which seems irrelevant).
 
Upvote 0

Idan Arad

Member
Licensed User
Longtime User
ok , i got this solved:
upgrading from B4A v4.3 to B4A I had to completely uninstall b4a , rename the 2 following libraries
  • %appdata%\Anywhere Software
  • C:\Program Files (x86)\Anywhere Software
and then reinstall b4a V6.5.
At this point the appodeal demo compiles and runs with no issue.
 
Upvote 0
Top