TroubleshootingChangelogDocs

Integration process in eclipse

1. Integration process in eclipse

Eclipse adroid native 1

2. In context menu select Import...

Eclipse adroid native 2

3. In the window that opens, select General/File System and click Next

Eclipse adroid native 3

4. Click Browse ... button and specify path of jar files. Place a checkmark next to all libraries (applovin-sdk, appodeal, chartboost, my-target, unity-ads). Click Finish button.

Eclipse adroid native 4

5. Right-click on your project, in context menu select choose Build Path -> Configure Build Path

Eclipse adroid native 5

6. In the window that opens, select the Libraries tab, then click button Add JARs...

Eclipse adroid native 6

7. Expand structure of your project, navigate to the folder libs and select all necessary jar files. Click Ok button.

Eclipse adroid native 7

ACCESS_COARSE_LOCATION

If you do not want to specify in your application

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

then you must call the following method before initializing:

Appodeal.disableLocationPermissionCheck();

But these two are to be used:

<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

as they are used by many networks.

If you receive an error message:
java.lang.NoClassDefFoundError: com.appodeal.ads.c

then maybe you have the old Google Play Services

Try updating the android SDK and Google Play Services through the SDK Manager.

Ads are not displaying after integration

The problem may be in case if you try to show an ad immediately after initialization. Please note, that it takes some time to load an advertisment.

To show ads right after loading use this approach:

Appodeal.setAutoCache(Appodeal.INTERSTITIAL, false); Appodeal.initialize(this, appKey, Appodeal.INTERSTITIAL); Appodeal.cache(this, Appodeal.INTERSTITIAL); Appodeal.setInterstitialCallbacks(new InterstitialCallbacks() { public void onInterstitialLoaded(boolean isPrecache) { Appodeal.show(MainActivity.this, Appodeal.INTERSTITIAL); } public void onInterstitialFailedToLoad() { } public void onInterstitialShown() { } public void onInterstitialClicked() { } public void onInterstitialClosed() { } });

And use

Message "dontskipnonpubliclibraryclassmembers"

If you see a message "dontskipnonpubliclibraryclassmembers" it may indicate that not all settings were made in the Proguard.

Add the following to your Proguard config file:

-keep class com.appodeal.** { *; } -keep class com.amazon.** { *; } -keep class com.mopub.** { *; } -keep class com.facebook.** { *; } -keep class org.nexage.** { *; } -keep class com.applovin.** { *; } -keep class com.chartboost.** { *; } -keep class com.unity3d.ads.** { *; } -keep class com.applifier.** { *; } -keep class com.yandex.** { *; } -keep class com.inmobi.** { *; } -keep class com.yandex.** { *; } -keep class ru.mail.android.mytarget.** { *; } -keep class net.pubnative.** { *; } -keep class org.droidparts.** { *; } -keep class com.google.android.gms.ads.** { *; } -keep class com.google.android.gms.common.GooglePlayServicesUtil { *; } -keepattributes Signature -keep class * extends java.util.ListResourceBundle { protected Object[][] getContents(); } -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { public static final *** NULL; } -keepnames @com.google.android.gms.common.annotation.KeepName class * -keepclassmembernames class * { @com.google.android.gms.common.annotation.KeepName *; } -keepnames class * implements android.os.Parcelable { public static final ** CREATOR; } -dontwarn com.facebook.** -dontwarn com.jirbo.adcolony.** -dontwarn com.vungle.** -dontwarn com.startapp.** -dontwarn com.yandex.** -dontwarn com.inmobi.** -dontwarn com.chartboost.** -dontwarn com.avocarrot.** -dontwarn com.flurry.** -dontwarn net.pubnative.** -dontwarn org.droidparts.** -keep class android.support.v4.app.Fragment { *; } -keep class android.support.v4.app.FragmentActivity { *; } -keep class android.support.v4.app.FragmentManager { *; } -keep class android.support.v4.app.FragmentTransaction { *; } -keep class android.support.v4.content.LocalBroadcastManager { *; } -keep class android.support.v4.util.LruCache { *; } -keep class android.support.v4.view.PagerAdapter { *; } -keep class android.support.v4.view.ViewPager { *; } -keep class android.support.v7.widget.RecyclerView { *; } -keep class android.support.v7.widget.LinearLayoutManager { *; }
Runtime Classes Loading/ Dex 65536 Problem Resolving Android Native

Important Note: Minimum Android API level for this method is 14.

Dex Preparation

Copy all libraries (classes) that you want include to *.dex to some folder, name it as you want, place it in some folder.

Run console

Important note: %ANDROID_SDK_PATH%\build-tools\%VERSION% must be added to system path variable in other case please use full path to dx/dx.bat file.

For Windows run following commands in cmd/Cygwin:

$ cd “path/to/your/folder” $ dx.bat --dex --output=classes.dex .

For OS X run following commands in console:

$ cd “path/to/your/folder” $ dx --dex --output=classes.dex .

This will generate classes.dex in the same folder.

Android Native Usage

Download AppodealDinamicDex.jar library, add it to your project libs folder.

Connect usual libraries to project as provided:

Android Studio: open module settings go to dependensies and change scope to provided.

Eclipse: You could do this by going to Project > Properties > Java Build Path > Libraries and then add that jar as an external jar.

Copy your generated *.dex file or files to assets folder. (generated Appodeal.dex)

Add following code to your activities onCreate:

String[] DEX_FILES = {"classes.dex"}; LoadDex.instance().loadDex(this, DEX_FILES);

Note that you can put there multiple dex files, for example:

String[] DEX_FILES = {"classes1.dex", "classes2.dex"}; LoadDex.instance().loadDex(this, DEX_FILES);

Now you can call your code as do it before.

Eclipse Sample Project with Appodeal.dex