0

It's been now two days I'm fighting with this issue.

I'm trying to build a cordova project that built marvelously like 1 month ago.

In between these time periods I had to change my PC so I installed again Java, Android Studio and Cordova, setting it up as usual.

I installed Google Repository (v58) as well as Android Support Repository (v47.0.0) in the SDKManager. They appears to be the latest since I tried to uninstall and reinstall them twice.

I didn't change my project's configuration since I took a backup of it when it was working to start again.

When I run cordova build android, I got this error:

A problem occurred configuring root project 'android'. Could not resolve all dependencies for configuration ':_debugApkCopy'. Could not find com.android.support:appcompat-v7:27.0.2. Searched in the following locations: file:/C:/Users/Pierrick/AppData/Local/Android1/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom file:/C:/Users/Pierrick/AppData/Local/Android1/extras/android/m2repository/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar file:/C:/Users/Pierrick/Desktop/hAz4rd0uS-uphair-1af95815ef72/hAz4rd0uS-uphair-1af95815ef72/platforms/android/sdk-manager/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.jar

These files are needed by plugins cordova-plugin-mapbox (v1.2.3) and cordova-plugin-facebook4 (v1.9.1). Obviously, I checked the "extras" folder in my Android SDK directory, and the last version of Android support I got is 26.0.0-alpha1.

How can I manage to download the requested files in the good location ? Is it supposed to be done automatically ? I really don't see what I am missing here, some help would really be appreciated.

I tried to:

-Reinstall cordova-android by cordova platform rm android and cordova platform add android@6.2.3;

-Delete gradle's android support's cache and metadatas as stated here;

-Reinstall Google repository and Android Support repository twice from Android Studio SDK Manager as stated here.

This is drivin' me nuts.

Pierrick Martellière
  • 1,554
  • 3
  • 21
  • 42

1 Answers1

0

I just cam accross my problem and since I didn't see doublons of this thread I'm posting the answer here. As stated in this thread the issue is caused by the facebook sdk. If you run in cordova CLI you simply have to modify the platforms/android/project.properties file.

Change this line:

cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+

into this line:

cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.26.0

As stated in the relative thread, this is a hack.

Pierrick Martellière
  • 1,554
  • 3
  • 21
  • 42