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

Android打包报错:Entry name 'META-INF...'冲突问题求助

Fixing "Entry name 'META-INF/androidx.vectordrawable_vectordrawable.version' collided" in Android Studio

Hey there! This collision error is super common when adding third-party SDKs (like ads) to your project—here’s how to fix it step by step:

Why this happens

The error means multiple dependencies in your project (your core app code + the new ad SDK you added) are including the same androidx.vectordrawable version metadata file. When Android Studio tries to package the APK, it hits a duplicate entry and crashes.

Solution 1: Exclude duplicate dependencies from the ad SDK

First, identify which dependency is bringing in the duplicate vectordrawable library. Run this command in your project root to see the full dependency tree:

./gradlew app:dependencies

Look for entries related to androidx.vectordrawable:vectordrawable or androidx.vectordrawable:vectordrawable-animated that appear multiple times (once from your project, once from the ad SDK).

Then, exclude the duplicate from your ad SDK implementation in your app’s build.gradle (Module level):

implementation('com.google.android.gms:play-services-ads:22.4.0') { // Replace with your ad SDK version
    exclude group: 'androidx.vectordrawable', module: 'vectordrawable'
    exclude group: 'androidx.vectordrawable', module: 'vectordrawable-animated'
}

Solution 2: Force a unified version for all dependencies

If excluding doesn’t work, you can force every dependency in your project to use the same vectordrawable version. Add this to your project’s root build.gradle file:

dependencyResolutionManagement {
    versions {
        androidxVectordrawable = "1.1.0" // Use the stable version your project already uses
    }
    resolutionStrategy {
        force "androidx.vectordrawable:vectordrawable:$androidxVectordrawable"
        force "androidx.vectordrawable:vectordrawable-animated:$androidxVectordrawable"
    }
}

Solution 3: Clean up caches and rebuild

Sometimes stale cache files cause weird packaging issues. Do a full clean:

  1. Go to File > Invalidate Caches... in Android Studio, then select Invalidate and Restart
  2. Or run these commands in your terminal:
    ./gradlew clean
    ./gradlew assembleDebug
    

Quick check for animation-list resources

While the error points to a version file collision, double-check your new animation-list drawables to make sure they don’t have duplicate filenames or invalid XML syntax—though this is less likely to cause this specific error, it’s good to rule out.


内容的提问来源于stack exchange,提问作者Álvaro Sánchez

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.07 22:47:45