I'm trying to add mopub to my app. I installed the sdk through the AndroidStudio plugin. and added this to my xml
<com.mopub.mobileads.mopubview
android:id="@+id/adview"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="50dp">
</com.mopub.mobileads.mopubview>
But it gives me these errors:
The following classes could not be found:
- com.mopub.mobileads.mopubview (Fix Build Path, Create Class)
and when I run the app it crashes:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hroshandel.myapplication/com.example.hroshandel.myapplication.SimpleIntro_FragmentActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class com.mopub.mobileads.mopubview
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.mopub.mobileads.mopubview
at com.example.hroshandel.myapplication.SimpleIntro_FragmentActivity.onCreate(SimpleIntro_FragmentActivity.java:20)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mopub.mobileads.mopubview" on path: DexPathList[[zip file "/data/app/com.example.hroshandel.myapplication-4.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.hroshandel.myapplication-4, /vendor/lib, /system/lib]]
Obvious question did you followed setup process https://dev.twitter.com/mopub/android/getting-started
EDIT:
There is GRADLE
Copy into your project
Add to your build.gradle