cordovaionic-frameworkionic3android-volleycordova-8.0.0

Ionic Cordova app, started getting Could not find pub.devrel:easypermissions:0.4.0 and com.android.volley:volley:1.1.0 errors


This month, August 2024, we started getting an error in our Cordova Ionic build pipeline that says the following:

Could not find pub.devrel:easypermissions:0.4.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/pub/devrel/easypermissions/0.4.0/easypermissions-0.4.0.pom - https://repo.maven.apache.org/maven2/pub/devrel/easypermissions/0.4.0/easypermissions-0.4.0.pom - https://jcenter.bintray.com/pub/devrel/easypermissions/0.4.0/easypermissions-0.4.0.pom - https://maven.google.com/pub/devrel/easypermissions/0.4.0/easypermissions-0.4.0.pom - https://jitpack.io/pub/devrel/easypermissions/0.4.0/easypermissions-0.4.0.pom - file:Mobile/platforms/android/app/libs/easypermissions-0.4.0.jar - file:Mobile/platforms/android/app/libs/easypermissions.jar Required by: project :app > Could not find com.android.volley:volley:1.1.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.0/volley-1.1.0.pom - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.0/volley-1.1.0.pom - https://jcenter.bintray.com/com/android/volley/volley/1.1.0/volley-1.1.0.pom - https://maven.google.com/com/android/volley/volley/1.1.0/volley-1.1.0.pom - https://jitpack.io/com/android/volley/volley/1.1.0/volley-1.1.0.pom - file:Mobile/platforms/android/app/libs/volley-1.1.0.jar - file:Mobile/platforms/android/app/libs/volley.jar Required by: project :app

Please note that our app is fairly old, and has some old dependencies. We are using ionic v3 and cordova v8.


Solution

  • As it turns out, the packages for com.android.volley:volley:1.1.0 and pub.devrel:easypermissions:0.4.0 were removed from public repos like Maven.

    Steps to follow:

    1. Search and download the .jar files for those libraries from the internet.
    2. Commit these files anywhere into your repo.
    3. In your pipeline, and before the ionic cordova build step, copy these files to ~/platforms/android/app/libs/.
    4. If you haven't done so already, create a build-extras.gradle file in ~/scripts/android folder.
    5. Edit the build-extras.gradle file to include the following:
    configurations.all {
        exclude group: 'com.android.volley', module: 'volley'
        exclude group: 'pub.devrel', module: 'easypermissions'
    }
    
    
    dependencies {
        implementation files('libs/volley-1.1.0.jar')
        implementation files('libs/easypermissions-0.4.0.jar')
    }