我在整合steps from MoPub时遇到了问题:
此时我感到困惑,因为我已经将我的appID和appSignature输入到MoPub的信息中心。我删除了 Chartboost.startWithAppId(this,appId,appSignature); 并且只保留onCreate但 MoPub的ChartboostInterstitial类仍然被标记为未使用。这不是&#39 ;似乎没错。
有什么想法吗? MoPub在这方面的文档似乎不清楚。
答案 0 :(得分:1)
您需要执行的步骤:
ChartboostInterstitial.java
和ChartboostShared.java
添加到您的项目的app/src/main/java/com/mopub/mobileads/
libs/
并添加play-services-ads:8.4.0作为依赖项。下载Chartboost SDK jar here。检查您是否添加了所需的所有库,Activity
中声明的所有AndroidManifest.xml
和所需权限。
的AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application>
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.RewardedMraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.chartboost.sdk.CBImpressionActivity"
android:excludeFromRecents="true"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:configChanges="keyboardHidden|orientation|screenSize" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
</application>
如果您使用Gradle,那么您的build.gradle
依赖项应该看起来像这样:
dependencies {
// ... other project dependencies
// Compile the chartboost.jar in libs/
compile fileTree(dir: 'libs', include: ['*.jar']
// Google Play Services
compile 'com.google.android.gms:play-services-ads:8.4.0
//MoPub
compile('com.mopub:mopub-sdk:4.12.0@aar') {
transitive = true
}
compile('com.mopub:mopub-sdk-interstitial:4.12.0@aar') {
transitive = true
}
compile 'com.mopub.volley:mopub-volley:1.1.0'
compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:support-annotations:22.0.+'
compile 'com.android.support:recyclerview-v7:22.0.+'
}