Run Android platform error with "cordova-plugin-facebook4"

Hello, this morning I got the error when I try to build my app to my Android phone.
The error tell me that "Could not find com.android.support:support-v4:27.0.1."
I test remove “cordova-plugin-facebook4” and my app can build to Android again, but I realy need this plugin.
Full error message:


* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
   > Could not find com.android.support:support-v4:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
     Required by:
         project :
   > Could not find com.android.support:support-v4:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
     Required by:
         project :
   > Could not find com.android.support:appcompat-v7:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
     Required by:
         project :
   > Could not find com.android.support:customtabs:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
     Required by:
         project : > com.onesignal:OneSignal:3.5.7
   > Could not find com.android.support:support-v4:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
     Required by:
         project : > com.google.android.gms:play-services-maps:11.0.4 > com.google.android.gms:play-services-basement:11.0.4
   > Could not find com.android.support:support-annotations:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
   > Could not find com.android.support:support-core-utils:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-core:4.29.0
   > Could not find com.android.support:appcompat-v7:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:cardview-v7:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:customtabs:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/customtabs/27.0.1/customtabs-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0
   > Could not find com.android.support:support-v4:27.0.1.
     Searched in the following locations:
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
         file:/Users/cglt_0029/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
         file:/Users/cglt_0029/Desktop/hybrid-mobile-loyalty/platforms/android/sdk-manager/com/android/support/support-v4/27.0.1/support-v4-27.0.1.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.29.0 > com.facebook.android:facebook-common:4.29.0

If you have any recommendation tell me please.

1 Like

Hello, I got same error this morning. I’m trying to solve it, if I success, let you know it.

Did you create an issue at the plugin’s Git repo?

I did not create issue at git repo yet.

Me and My friend got this the sam issue.

I solved it.

npm install -g ionic@latest
npm install -g cordova@latest
npm install -g cordova-android@latest
ionic cordova platform rm android
ionic cordova platform add android
cordova plugin rm cordova-plugin-compat --force
cordova plugin add cordova-plugin-compat@latest

If you get permission error, use sudo.

I removed platform and added again, then it worked. Try it.

6 Likes

Hey…thank you. It works for me.

Hi it does not work for me .I have my node_modules installed in the same directory ,should I run all the commands without -g then?

Hi i am also getting this error. The solution is not working for me. i tried without -g command also. anyone solve this issue ??
if i remove the facebook plugin it’s working.

same issue here I also ran it with and without -g .Actually im facing this issue while running the npm install -g cordova-android@latest command : http://prntscr.com/hju8r8

Hi,

I had the same issue with cordova-plugin-facebook4 this morning, however I am using phonegap build and not ionic. I have solved the issue and wanted to write it here in case it helps.
Use a specific release of the plugin instead of the latest.
For example on phonegap build I was using 1.9.0 (circa the latest) and it all of a sudden stopped working today.
I have changed the version to 1.7.4 and the plugin is working now.
See the compatibility section here:
https://www.npmjs.com/package/cordova-plugin-facebook4

npm install -g ionic@latest
npm install -g cordova@latest
npm install -g cordova-android@latest
ionic cordova platform rm android
ionic cordova platform add android //my version is 6.3.0
cordova plugin rm cordova-plugin-compat --force
cordova plugin add cordova-plugin-compat@1.2

Hope you get luck. This solves my problem

1 Like

Just tried to build my app for the first time today. I noticed a lot of unexpected downloads (see log here under) but the build went thru with success

Would you like to give a try again? Maybe these libs weren’t published when you tried earlier today?

Download https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml
Download https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/4.29.0/facebook-android-sdk-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-core/4.29.0/facebook-core-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-login/4.29.0/facebook-login-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-share/4.29.0/facebook-share-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-common/4.29.0/facebook-common-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-places/4.29.0/facebook-places-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-applinks/4.29.0/facebook-applinks-4.29.0.pom
Download https://jcenter.bintray.com/com/facebook/android/facebook-messenger/4.29.0/facebook-messenger-4.29.0.pom
Download https://maven.google.com/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.pom
Download https://maven.google.com/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.pom
Download https://maven.google.com/com/android/support/customtabs/27.0.1/customtabs-27.0.1.pom

Download https://maven.google.com/com/android/support/support-compat/27.0.1/support-compat-27.0.1.pom
Download https://maven.google.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.pom
Download https://maven.google.com/com/android/support/support-fragment/27.0.1/support-fragment-27.0.1.pom
Download https://maven.google.com/com/android/support/support-core-ui/27.0.1/support-core-ui-27.0.1.pom

Download https://maven.google.com/com/android/support/support-media-compat/27.0.1/support-media-compat-27.0.1.pom
Download https://maven.google.com/com/android/support/support-annotations/27.0.1/support-annotations-27.0.1.pom

Download https://maven.google.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom
Download https://maven.google.com/com/android/support/support-vector-drawable/27.0.1/support-vector-drawable-27.0.1.pom
Download https://maven.google.com/com/android/support/animated-vector-drawable/27.0.1/animated-vector-drawable-27.0.1.pom

Download https://jcenter.bintray.com/com/facebook/android/facebook-login/4.29.0/facebook-login-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/4.29.0/facebook-android-sdk-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-share/4.29.0/facebook-share-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-common/4.29.0/facebook-common-4.29.0.aar

Download https://maven.google.com/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.aar

Download https://maven.google.com/com/android/support/support-v4/27.0.1/support-v4-27.0.1.aar
Download https://jcenter.bintray.com/com/facebook/android/facebook-applinks/4.29.0/facebook-applinks-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-places/4.29.0/facebook-places-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-messenger/4.29.0/facebook-messenger-4.29.0.aar

Download https://jcenter.bintray.com/com/facebook/android/facebook-core/4.29.0/facebook-core-4.29.0.aar

Download https://maven.google.com/com/android/support/support-fragment/27.0.1/support-fragment-27.0.1.aar

Download https://maven.google.com/com/android/support/support-core-utils/27.0.1/support-core-utils-27.0.1.aar

Download https://maven.google.com/com/android/support/support-media-compat/27.0.1/support-media-compat-27.0.1.aar

Download https://maven.google.com/com/android/support/cardview-v7/27.0.1/cardview-v7-27.0.1.aar

Download https://maven.google.com/com/android/support/customtabs/27.0.1/customtabs-27.0.1.aar

Download https://maven.google.com/com/android/support/animated-vector-drawable/27.0.1/animated-vector-drawable-27.0.1.aar

Download https://maven.google.com/com/android/support/support-core-ui/27.0.1/support-core-ui-27.0.1.aar

Download https://maven.google.com/com/android/support/support-vector-drawable/27.0.1/support-vector-drawable-27.0.1.aar

Download https://maven.google.com/com/android/support/support-compat/27.0.1/support-compat-27.0.1.aar

I solved this problem by reverse facebook version to 1.7.4
cordova plugin rm cordova-plugin-facebook4
ionic cordova plugin add cordova-plugin-facebook4@1.7.4 --variable APP_ID= --variable APP_NAME=

7 Likes

This solution worked for me. Thanks.

Yes this worked for me too - thanks!

If I may, downgrading is not a solution, it’s a workaround :wink:

Keep an eye on it

1 Like

When you said that a lot of downloads were made when you build you project, by any chance do you have installed the plugin cordova-android-support-gradle-release? I was reading about a similar problem reported with version 1.9.1 of the facebook4 plugin and someone suggests to install the gradle-release plugin: https://stackoverflow.com/questions/44235605/cordova-manifest-merger-failed/44311407#44311407

1 Like

No I didn’t (just double checked and searched all references of cordova-android-support-gradle-release, just find some in a README of another plugin, nothing more)

Just in case my Ionic Info. Also I have the last version of Android Studio 3.0 installed

Also note, I still have cordova-plugin-compat in my references (it look like some of the unexpected download mentioned above contains the name compat)

cli packages: ()

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0 
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

@ionic/app-scripts : 3.1.4
Cordova Platforms  : android 6.4.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2 
ios-sim           : 5.0.13 
Node              : v8.8.1
npm               : 5.5.1 
OS                : macOS Sierra
Xcode             : Xcode 9.1 Build version 9B55 

Environment Variables:

ANDROID_HOME : /Users/me/Library/Android/sdk

Misc:

backend : pro