You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android项目集成Appodeal原生广告遇Manifest配置错误求助

Fixing Google Play Services Ads Manifest Errors for Appodeal Native Ads Integration

Hey, I’ve helped a handful of developers work through this exact issue when integrating Appodeal ads. The red errors you’re seeing boil down to missing dependencies or incomplete Activity configuration. Let’s fix this step by step:

1. Add the Google Play Services Ads Dependency

First, make sure you’ve included the required Ads library in your module-level build.gradle (not the project-level one). This is the most common root cause:

dependencies {
    // Replace with the latest version (check Google's official docs for updates)
    implementation 'com.google.android.gms:play-services-ads:22.6.0'
}

After adding this, click "Sync Now" in Android Studio to let Gradle pull in the dependency.

2. Fix the Incomplete AdActivity Declaration

The AdActivity line you posted is missing its closing tag and required configuration attributes. Replace it with this full, correct declaration:

<activity
    android:name="com.google.android.gms.ads.AdActivity"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
    android:exported="false" />

The configChanges attribute is mandatory for AdActivity to handle screen rotations and input changes properly. The exported flag is required for Android 12+ since this activity doesn’t need to be accessible to external apps.

3. Resolve the google_play_services_version Error

If you’re still getting an error for @integer/google_play_services_version, try these fixes:

  • Preferred method: Wait for Gradle to finish syncing the Ads dependency—this integer resource is automatically generated when the library is properly imported.
  • Alternative method: Replace the reference with the specific version code for your Play Services library. For example:
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="2131099648" />
    
    (Note: This value corresponds to recent Play Services versions, but using the @integer reference is better for future compatibility.)

4. Double-Check Appodeal Configuration

Since you’re integrating Appodeal, make sure its core dependency is also in your build.gradle:

implementation 'com.appodeal.ads:sdk:3.1.1' // Use the latest Appodeal SDK version

Also, confirm you’ve added Appodeal’s required initialization code in your Application class’s onCreate() method, and any other Appodeal-specific Manifest entries are present.

Once you’ve made these changes, clean your project (Build > Clean Project) and rebuild. That should clear up all the red errors in your AndroidManifest.xml.

内容的提问来源于stack exchange,提问作者Arman Hossain

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:18:14