cordova-plugin-facebook-connect / cordova-plugin-facebook-connect

Use the latest Facebook SDK in your Cordova and Ionic projects
Other
63 stars 90 forks source link

Android will not build - no issue with IOS #115

Open jasonandress opened 2 years ago

jasonandress commented 2 years ago

[X] I'm reporting a reproducible issue with the code [ ] I'm reporting a feature request

cordova build android fails with errors relating to all values in values.xml files. The project builds without the plugin and fails with the plugin.

Create new cordova project, add android 10.1.1, add this plugin 3.2.0 then cordova emulate android

Task :app:mergeDebugResources /Users/jasonandress/.gradle/caches/transforms-3/d291a6f185053cd23b616e4ab375bb6e/transformed/appcompat-1.3.1/res/values/values.xml:8:4: Invalid for given resource value.

Expected Behavior

Project builds with plugin

Plugin version, OS, devices, etc

Cordova Packages:

cli: 11.0.0
    common: 4.0.2
    create: 4.0.0
    lib: 11.0.0
        common: 4.0.2
        fetch: 3.0.1
        serve: 4.0.0

Project Installed Platforms:

android: 10.1.1

Project Installed Plugins:

cordova-plugin-device: 2.0.2
cordova-plugin-facebook-connect: 3.2.0
cordova-plugin-ionic-keyboard: 2.2.0
cordova-plugin-ionic-webview: 5.0.0
cordova-plugin-splashscreen: 5.0.2
cordova-plugin-statusbar: 2.4.2

Environment:

OS: macOS Monterey 12.1 (21C52) (darwin 21.2.0) x64
Node: v12.22.9
npm: 6.14.15
gradle: 7.4.1
java: 11
jasonandress commented 2 years ago

I finally figured out what's wrong. I'll document it just incase someone else has the problem.

Installing this plugin with the variables to turn off logging of things, i.e. --variable FACEBOOK_HYBRID_APP_EVENTS=“false” --variable FACEBOOK_AUTO_LOG_APP_EVENTS="false" --variable FACEBOOK_ADVERTISER_ID_COLLECTION="false"

For me it causes Android to not compile with the weird error above.

Removing and reinstalling the plugin without these parameters, now Android builds again. I've set these variables in the package.json file, hopefully it'll work that way.

I was just about to remove this plugin and have to migrate my users off of Facebook.