我正在尝试将mopub添加到我的应用中 . 我通过AndroidStudio插件安装了sdk . 并将此添加到我的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>
但它给了我这些错误:
The following classes could not be found:
- com.mopub.mobileads.mopubview (Fix Build Path, Create Class)
当我运行应用程序时崩溃:
java.lang.RuntimeException:无法启动活动ComponentInfo {com.example.hroshandel.myapplication / com.example.hroshandel.myapplication.SimpleIntro_FragmentActivity}:android.view.InflateException:二进制XML文件行#15:错误输出类com . mopub.mobileads.mopubview引起:android.view.InflateException:二进制XML文件行#15:在com.example.hroshandel.myapplication.SimpleIntro_FragmentActivity.onCreate(SimpleIntro_FragmentActivity.java:20)中输入类com.mopub.mobileads.mopubview时出错引起:java.lang.ClassNotFoundException:在路径上找不到类“com.mopub.mobileads.mopubview”:DexPathList [[zip file“/data/app/com.example.hroshandel.myapplication-4.apk”] ,nativeLibraryDirectories = [/ data / app-lib / com.example.hroshandel.myapplication-4,/ vendor / lib,/ system / lib]]
3 回答
请检查 class 名称的错字,在文档中写一个天才:
但正确的 class 名称是:
好像你必须如上面的答案中所述修复你的gradle . 但除此之外,我有相同的错误消息运行应用程序,这是我如何能够解决它:
您是否按照设置流程提出了明显的问题https://dev.twitter.com/mopub/android/getting-started
编辑:
有GRADLE
复制到您的项目中
添加到build.gradle