Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Unable to load class #1

Open
peter1408 opened this issue Sep 7, 2017 · 5 comments
Open

Unable to load class #1

peter1408 opened this issue Sep 7, 2017 · 5 comments

Comments

@peter1408
Copy link

i have included your project to my gradle and all was going fine with my implementaion for medaition of MoPub with Facebook : but i got a pop with this error in my log

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.github.ayltai.mopub.adapter.FacebookNativeAd" on path: DexPathList[[zip file "/data/app/com.ezydev.phonecompare-2/base.apk"],nativeLibraryDirectories=[/data/app/com.ezydev.phonecompare-2/lib/arm, /vendor/lib, /system/lib]]

@OverRide
public void onNativeLoad(final com.mopub.nativeads.NativeAd nativeAd) {
Log.i(this.getClass().getSimpleName(), "Native ad loaded");

    nativeAd.setMoPubNativeEventListener(this);
    final StaticNativeAd staticNativeAd = (StaticNativeAd)nativeAd.getBaseNativeAd();
   

    if (staticNativeAd instanceof FacebookNativeAd) {
        Log.i(this.getClass().getSimpleName(), "Native ad loaded FacebookNativeAd");
    }
}

screenshot 28
screenshot 29

@peter1408
Copy link
Author

and is their a way i can know if the ad is of FACEBOOK or Google on onNativeLoad() fun . or is it the instance of StaticNativeAd that will help me with this separate identification ??? Please help with integration

@peter1408
Copy link
Author

and their is no call named
org.github.ayltai.mopub.adapter.FacebookNativeEvent

@ayltai
Copy link
Owner

ayltai commented Sep 7, 2017

Is it debug build or release build?

In release build, if you use ProGuard or some other similar tools to obfuscate your app code, you have to add org.github.ayltai.mopub.* to your proguard-rules.pro filter.

@ayltai
Copy link
Owner

ayltai commented Sep 7, 2017

To know which ad provider is the ad loaded from, yes, you can check the instance type, or log it inside the adapter (but you have to fork this repo to modify it).

@ayltai
Copy link
Owner

ayltai commented Sep 7, 2017

Thanks @peter1408 for pointing out the incorrect event name. It should be org.github.ayltai.mopub.adapter.FacebookEventNative

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants