Execution failed for task ':app:processDebugManifest' after Android Studio 2.2 update

匿名 (未验证) 提交于 2019-12-03 08:35:02

问题:

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@android:style/Theme.Translucent.NoTitleBar) from AndroidManifest.xml:28:13-72 is also present at [com.facebook.android:facebook-android-sdk:4.16.0] AndroidManifest.xml:32:13-63 value=(@style/com_facebook_activity_theme) Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:24:9-28:75 to override


Manifest file:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.droid.bdapp.test">       <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />     <uses-permission android:name="android.permission.INTERNET" />     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />       <application         android:name="com.test.app.app.AppBaseApplication"         android:allowBackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:supportsRtl="true"         android:theme="@style/AppTheme">          <meta-data             android:name="com.facebook.sdk.ApplicationId"             android:value="@string/facebook_app_id" />          <activity             android:name="com.facebook.FacebookActivity"             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"             android:label="@string/app_name"             android:theme="@android:style/Theme.Translucent.NoTitleBar" />          <activity android:name="com.test.app.ui.activities.WelcomeActivity">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>          <activity             android:name="com.test.engine.reader.view.test5"             android:label="@string/app_name"             android:theme="@style/AppTheme"></activity>          <activity android:name="com.test.app.ui.activities.test1" />         <activity android:name="com.test.app.ui.activities.test2" />         <activity android:name="com.test.app.ui.activities.test3" />         <activity android:name="com.test.app.ui.activities.test4" />     </application>  </manifest> 

回答1:

It's not Android Studio 2.2 upgrade issue, it's FB SDK released yesterday. For now a solution is to revert to previous FB SDK in build.gradle:

dependencies {     // ...     compile 'com.facebook.android:facebook-android-sdk:4.15.0' } 

This worked for me, will track the change log and bug list on FB support to see the proper solution.



回答2:

I agree with the other answer, however, I would like to propose another solution.

Stick with the theme determined by Facebook by removing android:theme="@android:style/Theme.Translucent.NoTitleBar" and keep using compile 'com.facebook.android:facebook-android-sdk:4+'


Manifest file:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.droid.bdapp.test">      <activity             android:name="com.facebook.FacebookActivity"             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"             android:label="@string/app_name" /> 

Facebook wants to handle the themes for the webdialog spinners as stated in the changelog

Better handling of themes for webdialog spinners

Ref: https://developers.facebook.com/docs/android/change-log-4.x#4_16_0



回答3:

Add the compile dependency with the latest version of the Facebook SDK in the build.gradle file:

dependencies {            compile 'com.facebook.android:facebook-android-sdk:4.16.0' //Or 4.16.1              } 

DeadObjectExceptions Bugs fixed .



回答4:

Facebook has a new version released 27Sep16.

https://developers.facebook.com/docs/android/downloads/

Most build.gradle files automatically pick up the latest version (as per install instructions). It seems 4.16.0 has a problem for a number of users. To force use of previous version until this is resolved, edit your build gradle to use the previous version.

 compile ('com.facebook.android:facebook-android-sdk:4.15.0') 

I'd expect this to be resolved by Facebook shortly and you can revert your build.gradle to pick up the latest version once more.



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