Android App Bundle build error: reserved file

雨燕双飞 提交于 2019-11-30 12:52:20

Since October 31, Facebook released version 5.1 of the Audience Network SDK. Using

implementation 'com.facebook.android:audience-network-sdk:5.1.0'

fixed the issue for me.

In my case, my error was caused by

com.facebook.android:audience-network-sdk

I only downgrade audience-network-sdk from 5.0.0 to 4.99.3 and everything starting to work fine. I hope this help you.

Updated: As Sebastian said, now you can update audience-network-sdk from 5.0.0 to 5.1.0.

A much simpler fix until Facebook fixes the SDK would be to add this to the packagingOptions in the android { } block of your app's build.gradle:

android {
   packagingOptions {
      exclude 'AndroidManifest.xml' //This fixes a bug in FAN 5.0.1
   }
}

I can only confirm this works when building an App Bundle, I do not know about a regular APK.

If I'm reading the file tree right, you have your AndroidManifest.xml file in the res folder, which migth be the reason why you're seeing the error. Try to put the file in {ProjectName}/app/src/main and rebuild the project.

I ran into the same bug. Had to change a few things before getting a working build. For me it was:

  1. downgrade facebook audience-network-sdk from 5.0.0 to 4.28.2
  2. downgrade okio from 2.1.0 to 2.0.0
  3. update proguard config for okio, okhttp & retrofit
  4. not using R8

I hope this helps you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!