Reputation: 220
I have an existing app which this plugin runs fine, but today it decides to fail on me.
I can be certain that the below will very likely to re-produce the issue, once the plugin was installed, the app resulted to a blank screen after running "cordova run android". Terminal showed "LAUNCHED SUCCESS", no errors/stack trace.
Versions:
To reproduce this:
sdkmanager --licenses
. Make sure that app is registered in developers.facebook.com with get a proper APP_ID.cordova create appy222 appy222.com appy222
cordova plugin add cordova-plugin-facebook4 --variable APP_ID="whateverid" --variable APP_NAME="Appy222"
<config-file parent="/resources" target="./res/values/strings.xml">
<string name="fb_app_id">$APP_ID</string>
<string name="fb_app_name">$APP_NAME</string>
</config-file>
Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library...
when doing cordova run android
cordova platform add android
this will install [email protected]cordova run android
And the result was a blank screen...black. The app will run fine without cordova-plugin-facebook4.
Wonder if anybody came across this problem? Hope that someone could share some thoughts here.
Upvotes: 1
Views: 2261
Reputation: 76
Android build.gradle couldn't found $FACEBOOK_ANDROID_SDK_VERSION. So I changed it in ionic-cordova-facebook4 plugin. You can find root/plugins/cordova-plugin-facebook4/plugin.xml file.
Here you can find this setting
please change it to
finally ionic cordova platform rm android, ionic cordova platform add android ionic cordova run android Now All is ok!
Upvotes: 1
Reputation: 2980
You need to downgrade Facebook Android SDK version to 4.26.0
ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="app_id" --variable APP_NAME="app_name" --variable FACEBOOK_ANDROID_SDK_VERSION="4.26.0" --variable ANDROID_SDK_VERSION="4.26.0"
Remember to set both the variables ANDROID_SDK_VERSION & FACEBOOK_ANDROID_SDK_VERSION to avoid conflicts as some of the versions of cordova-plugin-facebook4 was referring to variable ANDROID_SDK_VERSION
Remember to remove and add android platform again.
Upvotes: 0
Reputation: 220
Posting an answer to my own question/problem. Seems that I need to down the Facebook's Android SDK version all the way to just 4.28.0 (instead of 4.36.0 which is the current at the moment of writing).
cordova plugin add cordova-plugin-facebook4 --variable APP_ID="whateverid" --variable APP_NAME="whateverappname" --variable ANDROID_SDK_VERSION="4.28.0"
Upvotes: 0
Reputation: 121
Had the same problem. What worked for me was removing the plugin, setting the facebook android sdk version to 4.35.0:
cordova plugin add cordova-plugin-facebook4 --variable APP_ID="whateverid" --variable APP_NAME="Appy222" --variable ANDROID_SDK_VERSION="4.35.0"
Then removing and readding the android platform:
cordova platform rm android
cordova platform add android
Upvotes: 1
Reputation: 9
Me too. I got the solution.It must be same name Google Play Package Name in dev facebook app and wiget id in config.xml.
Upvotes: -1