Search code examples
cordovaionic2cordova-pluginsionic3cordova-facebook

Ionic 3 cordova facebook native plugin gives error when build


I got this error when i tried to build my ionic project which has facebook native plugin.

Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not find com.android.support:customtabs:27.0.2.


Searched in the following locations:
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.pom
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.jar
         file:/Users/MacBook/Documents/MJMobile/giftin-app/platforms/android/sdk-manager/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-core:4.30.0
   > Could not find com.android.support:support-core-utils:27.0.2.
     Searched in the following locations:
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.pom
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.jar
         file:/Users/MacBook/Documents/MJMobile/giftin-app/platforms/android/sdk-manager/com/android/support/support-core-utils/27.0.2/support-core-utils-27.0.2.jar
     Required by:
         project : > com.facebook.android:facebook-android-sdk:4.30.0 > com.facebook.android:facebook-core:4.30.0
   > Could not find com.android.support:support-v4:27.0.2.
     Searched in the following locations:
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.pom
         file:/Users/MacBook/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar
         file:/Users/MacBook/Documents/MJMobile/giftin-app/platforms/android/sdk-manager/com/android/support/support-v4/27.0.2/support-v4-27.0.2.jar

I read through other solutions for this error at github,SO and many other forums. I tried all those solutions such as following

1.Replaced mavenCentral() in build.gradle file.

2.reinstalling android support repository.

3.re adding android platform into ionic project

But non of this solved the issue. Is there any solution/recommendation?

Thank you.


Solution

  • Finally I found the solution.

    Here is What i did.

    I was using cordova platform android 6.2.2. First i updated it into android 6.3.0

    cordova platform update [email protected]
    

    Then i got the following error

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

    Then I removed cordova android platform from my Ionic project. then I added the android 6.3.0

    cordova platform add [email protected]
    

    Then my errors fixed and project built successfully.

    Thank you.