RocketChat / Rocket.Chat.Cordova

Rocket.Chat Cross-Platform Mobile Application via Cordova (DEPRECATED)
MIT License
104 stars 109 forks source link

Facebook Activity Theme - merger failed - add 'tools:replace="android:theme"' to <activity> #138

Closed loredanacirstea closed 7 years ago

loredanacirstea commented 7 years ago

The issue was not present 3-4 days ago when I last tried to do an Android build. Now I get:

:processArmv7DebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugManifest'.
> Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@android:style/Theme.Translucent.NoTitleBar) from AndroidManifest.xml:19:184-243
    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 <activity> element at AndroidManifest.xml:19:9-246 to override.

I suppose the issue stems from the facebook plugin, so I opened an issue with them: https://github.com/jeduan/cordova-plugin-facebook4/issues/336 .

I will let you know if a plugin version update is needed.

By the way, the building process that I use is:

npm install ticons underscore
echo 'Bugsnag.apiKey = "YOUR-API-KEY-HERE";' > www/js/bugsnag_apikey.js
echo 'window.ANDROID_SENDER_ID = "YOUR-ANDROID-ID-HERE";' > www/shared/js/android_sender_id.js
sed -i -e 's/com.google.android.gms:play-services-plus:+/com.google.android.gms:play-services-plus:9.0.2/g' plugins/cordova-plugin-googleplus/plugin.xml
sed -i -e 's/com.google.android.gms:play-services-identity:+/com.google.android.gms:play-services-identity:9.0.2/g' plugins/cordova-plugin-googleplus/plugin.xml
sed -i -e 's/com.google.android.gms:play-services-gcm:+/com.google.android.gms:play-services-gcm:9.0.2/g' plugins/phonegap-plugin-push/plugin.xml
cordova platform add android
cordova build android
bharatpatel2005 commented 7 years ago

Hello, @loredanacirstea

Update config.xml,

plugin name="cordova-plugin-facebook4" spec="1.7.0" --> to --> plugin name="cordova-plugin-facebook4" spec="1.7.4"

Syirrus commented 7 years ago

Changing cordova-plugin-facebook4 to 1.7.4 still gives the same error. This FB plugin is a pain in the bottom. It's constantly breaking rocket.chat cordova. Any ideas on how to fix it?

maxlinux2000 commented 7 years ago

please have a look here: https://github.com/RocketChat/Rocket.Chat.Cordova/issues/151

loredanacirstea commented 7 years ago

Thank you @maxlinux2000 . In the end, using cordova-plugin-facebook4 ver. 1.7.4 solved it for me, so I will close this issue.

I left it open because @Syirrus said that the error persisted even with 1.7.4. If so, maybe opening another issue would be better.