Cordova Slack Digest

Mon, 27 Sep 2021 08:21:09 GMT

User count: 4629

Join the conversation at slack.cordova.io

Channel #general (13 messages)


Sun, 26 Sep 2021 22:34:49 GMT

@harel.mazor says

I‘m trying to upgrade my project to use latest versions of plugins and tools (i.e cordova-android 10.x, and latest plugins’ versions). I followed the upgraded instructions for cordova-android 10 and I‘m failing like a noob. šŸ˜ž I removed and added cordova android but it refuses to use latest version but instead it is using 9.x. so I placed it in dependencies instead of devDependencies and it started working. But I have the following error which I have no clue what causes this and how to solve this (I’m guessing it comes from one of the plugins, but those compiled well in 9.x). The following is the error message:

   > Could not find com.intentfilter:android-permissions:0.1.7.
     Searched in the following locations:
       - <https://dl.google.com/dl/android/maven2/com/intentfilter/android-permissions/0.1.7/android-permissions-0.1.7.pom>
       - <https://repo.maven.apache.org/maven2/com/intentfilter/android-permissions/0.1.7/android-permissions-0.1.7.pom>
     Required by:
         project :app```
The project is in the following github repo if anyone is interested:
<https://github.com/IsraelHikingMap/Site/tree/main/IsraelHiking.Web>
Any help would be appreciated.

Mon, 27 Sep 2021 00:34:32 GMT

@norman137 says

I just commented on your ticket you have in cordova-android but a patch was just landed in to fix an issue where cordova will restore using its default pin (currently ^9.0.0 for android) rather than using the value in devDependencies. This would occur if you have dependencies property defined in your package.json file.

Until the patch is actually released, the workaround would be to explicitly add your platform with your desired version via cordova platform add android@10

As for Could not find com.intentfilter:android-permissions:0.1.7... both <http://dl.google.com|dl.google.com> and .<http://repo.maven.apache.org|repo.maven.apache.org> doesn't seem to have the intentfilter/android-permissions package. I did find https://mvnrepository.com/artifact/com.intentfilter/android-permissions?repo=jcenter, but it seems to be from JCenter which I believed have closed down the servers.

Mon, 27 Sep 2021 04:22:36 GMT

@harel.mazor says

Is there an way for me to easily find the violating plugin? How come this worked in cordova-android 9 and now it stopped working? Did the default repo change? Is it restated to AndroidX change? I'm failing to understand why upgrading stuff will result in a missing package...

Mon, 27 Sep 2021 04:36:03 GMT

@erisu says

As Norman said, it is because one of your plugins is trying to use a library android-permissions which only comes form JCenter.

Since JCenter was deprecated and we donā€™t know how long they will keep the service running for. Previously there even set a timeline in which the API was going to be shutdown completely, but much later they decided to keep the API running for an indefinite period but will no longer accept new package submissions. We do not know still when this ā€œindefinite periodā€ ends.

Before they updated, we already started removing JCenter because of the concern that one day, it will just stop and cause all builds to fail. JCenter even gave developers ample warning and time to move their packages to maven central or some other repo.

https://github.com/apache/cordova-android/pull/1251

We dont know what plugin your using that uses it, so you might just need to search for android-permissions across all your plugins to see what is using it.

Mon, 27 Sep 2021 04:42:05 GMT

@erisu says

You can probably add the JCenter repo back to your project by using this feature, but just know that one day, the build might stop working again when JFrog has finally decided to kill off the JCenter API completely: https://github.com/apache/cordova-android/pull/867

Mon, 27 Sep 2021 04:42:46 GMT

@harel.mazor says

I think I found the relevant commit. However, it does not appear in the release notes of version 10. Since this is a breaking change it would be nice to have it there. :-) https://github.com/apache/cordova-android/pull/1251|https://github.com/apache/cordova-android/pull/1251 I still don‘t know of an easy way to find the violating plugin and couldn’t find in the docs how to add jcenter to the build as a custom gradle repo. I found the PR but couldn't reverse engineer it :-/...

Mon, 27 Sep 2021 04:43:27 GMT

@erisu says

??? It is in the release notes

Mon, 27 Sep 2021 04:43:32 GMT

@erisu says

https://github.com/apache/cordova-android/blob/master/RELEASENOTES.md

Mon, 27 Sep 2021 04:43:42 GMT

@erisu says

> https://github.com/apache/cordova-android/pull/1251|GH-1251Ā cleanup!: dropĀ jcenterĀ & update dependencies

Mon, 27 Sep 2021 04:43:47 GMT

@erisu says

The ! means breaking and it is also under the section Breaking:

Mon, 27 Sep 2021 04:48:58 GMT

@harel.mazor says

It‘s there, is just not highlighted as other breaking changes in the upper part. It was in that section in 9.1. Thanks for the explanation on how to properly read the release notes! I’m sure it'll be valuable in the future :-)

Mon, 27 Sep 2021 04:53:25 GMT

@erisu says

Anyways, as I pointed out before, you can custom define repos with this feature: https://github.com/apache/cordova-android/pull/867

All you need to do is create a new gradle file and call it whatever: e.g. custom-repos.gradle

Add the contents:

    mavenCentral()
    google()
    jcenter()
}```
Add to `config.xml` :
```&lt;resource-file src="custom-repos.gradle" target="repositories.gradle" /&gt;
&lt;resource-file src="custom-repos.gradle" target="app/repositories.gradle" /&gt;
&lt;resource-file src="custom-repos.gradle" target="CordovaLib/repositories.gradle" /&gt; ```
But as I said before, JFrog has already deprecated JCenter and is only keeping the API running to serve packages for an indefinite period of time. When they finally terminate the API, you will be back to square one with the missing library with failing buildsā€¦

The above is for a temporary work around so you can continue to get builds passing while you try to figure out what is relying on JCenter and update it.

Mon, 27 Sep 2021 05:13:55 GMT

@harel.mazor says

Thanks! I just want to split the upgrade effort - cordova-android first and only after that, when I have a working app, find and fix the relevant plugin and this “workaround”.

Channel #plugins (1 messages)


Mon, 27 Sep 2021 00:36:36 GMT

@norman137 says

yup, it's been migrated to cordova-android@10.x but as an allowlist, as an initiative to use more inclusive language. Cordova-android is the last platform that used the whitelist plugin, so it can be removed.