Cordova Slack Digest

Wed, 13 Apr 2022 08:22:44 GMT

User count: 4688

Join the conversation at slack.cordova.io

Channel #general (5 messages)


Tue, 12 Apr 2022 09:07:54 GMT

@alex678 says

Hello everybody, i'm mobile developper (4 apps iOS, 4 apps Android, 1 app windows) and i see some news from 2021 (multiple sources) meaning that Cordova will maybe not be “up to date” (for last iOS/Android versions) in the future. Do you have any news about that please ? Of course, i prefer to continue to use Cordova (command line).

Tue, 12 Apr 2022 09:11:59 GMT

@niklasmerz says

There is no official statement. I personally think Cordova will be able to keep up with Android and iOS for the future as we have some dedicated people working on int. I recently wrote about Cordova on my personal blog: https://blog.merzlabs.com/posts/cordova-2022/

Tue, 12 Apr 2022 09:12:19 GMT

@alex678 says

Ok perfect, thanks for info.

Tue, 12 Apr 2022 19:24:37 GMT

@alex678 says

Thanks a lot for your help today, it was difficult but i succesfully build my app with the last version of Android Studio then executed on the SDK 31 simulator. For moment there is still problem with very few plugins, but i can continue my tests to anticipate.

Tue, 12 Apr 2022 19:30:55 GMT

@norman137 says

Just to note that while my PR adds support to API 31 for the cordova android, it's only support at the core. Individual plugins themselves may require further updates to properly support API 31.

Channel #cordova-android (28 messages)


Tue, 12 Apr 2022 09:27:27 GMT

@alex678 says

Hello everybody, i try to build my app with Cordova 10 (sdk android 31) instead of Cordova 9 and sdk 30. But i get the following error. Do you have any idea please ? I use cordova-android-play-services-gradle-release 4.0.0

cordova platform add android@10.1.1 Using cordova-fetch for cordova-android@10.1.1 ... Installing “cordova-android-play-services-gradle-release” for android Subproject Path: CordovaLib Subproject Path: app Error: ENOENT: no such file or directory, open ‘./package.json’ at Object.openSync (fs.js:458:3) at Object.readFileSync (fs.js:360:35) at parsePackageJson (C:\Users\alex\Documents\GitHub\hooliapps\src\planningify\google\release\plugins\cordova-android-play-services-gradle-release\scripts\apply-changes.js💯37) ...

Tue, 12 Apr 2022 12:07:08 GMT

@norman137 says

seems like the plugin is looking for ./package.json, likely based on CWD so it‘s expecting that your cordova project has a package.json -- which it should, but it doesn’t exists.

Tue, 12 Apr 2022 12:23:15 GMT

@alex678 says

everything works for Cordova 9 (android sdk 30), there is a change about that ?

Tue, 12 Apr 2022 12:27:42 GMT

@norman137 says

There seems to be a disconnect in terminology...

Cordova (as in the cordova cli version) doesn‘t have anything to do with android, other than a specific cli version will default to a specific cordova-android major. cordova-android is the cordova’s android implementation, and version 9.x was built/tested for API 29, cordova-android@10.x (current latest) is built/tested against API 30.

Currently cordova doesn't support API 31, that will come in our next major release.

Tue, 12 Apr 2022 12:31:05 GMT

@norman137 says

But trying to target API 31 on cordova-android@10 usually yields actual build issues, not plugin installation issues.

My best advice is to determine where the plugin is trying to read ./package.json and ensure that file actually exists in the location it expects it. It may involve manually chaning it's script file at C:\Users\alex\Documents\GitHub\hooliapps\src\planningify\google\release\plugins\cordova-android-play-services-gradle-release\scripts\apply-changes.js to add additional logging.

Tue, 12 Apr 2022 12:32:52 GMT

@alex678 says

Ok thanks, it seems that the only plugin who crash is cordova-android-play-services-gradle-release

Tue, 12 Apr 2022 12:35:44 GMT

@norman137 says

yah so, if you‘re changing the target sdk to 31, even after you fix that plugin issue, you’ll run into build issues because API 31 requires the use of AGP (Android Gradle Plugin) 7.x - Which requires Java 11 and build tools 31.x

Tue, 12 Apr 2022 12:38:47 GMT

@alex678 says

so is best i want next cordova release ?

Tue, 12 Apr 2022 12:43:01 GMT

@norman137 says

For now it would be recommended to stick with cordova-android@10 targeting SDK 30. If you're deploying to Google Play store, then targeting SDK 30 is required.

Due to the volunteer nature of Apache projects I can't guarantee on any timelines for releases, but we do try to have required releases out to satisfy Google requirements.

Tue, 12 Apr 2022 12:44:56 GMT

@norman137 says

You could install my PR if you wanted to test API 31, but it does require some breaking changes to your environment.

Tue, 12 Apr 2022 12:52:46 GMT

@alex678 says

Thanks, where can i get more infos about your PR please for API 31 ? for me, is not a problem doing any change to my env. (i can regenerate it when i want).

Tue, 12 Apr 2022 12:59:15 GMT

@norman137 says

I'll update my PR with the details

Tue, 12 Apr 2022 13:01:19 GMT

@norman137 says

See “Other Remarks” - https://github.com/apache/cordova-android/pull/1410

Tue, 12 Apr 2022 13:01:49 GMT

@norman137 says

Let me know if you have any questions.

Needless to say, this isn't suitable for production releases, just for testing / feedback.

Tue, 12 Apr 2022 13:59:06 GMT

@alex678 says

I tried to follow all the tutorial, i added build tools in path also. But i still get this error. Any idea please ?

Tue, 12 Apr 2022 14:02:18 GMT

@norman137 says

Doesn‘t look like you’re using my PR

Tue, 12 Apr 2022 14:02:46 GMT

@alex678 says

I installed it with npm install C:\Users\alex\Documents\GitHub\cordova-android (i took with github your PR). But i will retry and recheck this.

Tue, 12 Apr 2022 14:03:15 GMT

@norman137 says

if you cloned my repo and switche dto my pr branch, you might need to npm pack it

Tue, 12 Apr 2022 14:03:21 GMT

@norman137 says

then install the tgz file

Tue, 12 Apr 2022 14:04:13 GMT

@norman137 says

alternatively you should be able to do cordova platform add <https://github.com/breautek/cordova-android.git#API31> as well

Tue, 12 Apr 2022 14:04:21 GMT

@alex678 says

ok i try that thx.

Tue, 12 Apr 2022 14:04:46 GMT

@norman137 says

and you 'd have to use cordova platform add not npm install

Tue, 12 Apr 2022 14:05:35 GMT

@norman137 says

cordova platform add does npm install behind the scenes, but it does some extra stuff as well in preparing the native project.

Tue, 12 Apr 2022 14:10:10 GMT

@alex678 says

Thanks a lot, with https github com breautek/cordova-android.git#API31" Build tool was found, i can continue my tests. Now it remains the error <plugin name=“cordova-android-play-services-gradle-release” spec=“4.0.0” /> i will continue to check

Tue, 12 Apr 2022 14:35:20 GMT

@alex678 says

For info, i found something not in the guide, and it seems mandatory, i needed to create the following file in the project. Then, the correct version of Gradle is loaded. What do you think about that please ?

Tue, 12 Apr 2022 14:36:35 GMT

@norman137 says

gradle should be configured on the first prepare/build

Tue, 12 Apr 2022 14:38:09 GMT

@norman137 says

Shouldn't need any manual intervention

Tue, 12 Apr 2022 14:39:43 GMT

@alex678 says

ok so i have maybe a problem with this. i will check

Channel #plugins (1 messages)


Tue, 12 Apr 2022 19:00:43 GMT

@alex678 says

Do you have any idea about this problem please ? Version 4.0.0 of the plugin, with last version of Cordova for Android SDK 31. Installing “cordova-android-play-services-gradle-release” for android Subproject Path: CordovaLib Subproject Path: app cordova-android-play-services-gradle-release: ERROR: EXCEPTION: Failed to load dependencies. If using cordova@6 CLI, ensure this plugin is installed with the --fetch option: Error: Cannot find module ‘C:\Users\alex\Documents\GitHub\hooliapps\src\planningify\google\release\node_modules\semver\index.js’. Please verify that the package.json has a valid “main” entry