Apache Cordova version


Tinn Aphopchung

Does Appbuilder still use cordova 9?

I try to force it to use cordova 10 and got a bug from camera plugin.Your sample project cannot show image after take screen shot.


decsoft

Hello Tinn,

By default DecSoft App Builder generates BATCH and SHELL files which do not indicates what version of Apache Cordova (or Cordova Android or Cordova iOS) will be used, so, in principle we use the latest version. If we are using the current generation of DecSoft App Builder we can specify a version of Cordova Android or Cordova iOS to be used from the right Android options and iOS options.

I recommend to use the latest version of Apache Cordova and Cordova Android and Cordova iOS, always that can be possible. This means that maybe some specific app uses certain specific plugin who works only in certain specific version of Cordova / Cordova Android / Cordova iOS. But what I recommend is to use the latest versions if possible. Something to note is that sometimes we can use a latest version of Cordova Android, for example (right now 10.1.1) and, if we did not specify that version in the referred options, the system (Cordova) pick an earlier version, so, we must specify the version that we want to use.

In the previous generation of DecSoft App Builder we cannot specify a Cordova Android or Cordova iOS version to be used, but we can edit the BATCH and SHELL files and look for this line, for example, in the case of Cordova Android:

In order to use a specific version of Cordova Android this is what we must to do:

That's the way to indicate what version we want to use, and, is valid for Cordova Android, Cordova iOS but also for Cordova plugins in general. Again, the above line (BATCH or SHELL files) must be only edited if we use the previous generation of DecSoft App Builder: in the current generation of the product we can indicate what version of Cordova Android or Cordova iOS to use from the above linked app options.



decsoft

Hello Tinn,

About the problem with the CordovaCamera sample in order to show the photo that we take when using "destination type = FILE_URI", there is an open issue in the Cordova Camera plugin Github project which refers to this problem. In principle must works, but, certainly someting avoid to be working it as expected. You can use the "destionation type = DATA_URL" as you can see also in the CordovaCamera sample app, or, if you want to continue using "FILE_URI", the below works for me:

That is, as you can see, what we do is to use the "app.cordova.file.getFileBlobFromFileUrl" method of the Cordova File plugin.



Tinn Aphopchung
Thank you,David.Your code work!

Tinn Aphopchung

I still dunno why app builder still use cordova-android 9.1.0 (not 10.1.1) when I remove version to force use. Try to remove cordova cli and install again,not fix it. check sdk-tool by update it via android studio,not fix it.


decsoft

Hello Tinn,

First of all, we must differenciate between DecSoft App Builder and Apache Cordova. What DecSoft App Builder is to generate the proper BATCH and SHELL files, but, after that, that is, when you run the files, all what we get is related with Apache Cordova, not with DecSoft App Builder. So your questions is a better questions... but for the Apache Cordova team, because it's Apache Cordova who pick what version of Cordova Android to be use.

I can suppose that the latest version of Apache Cordova (which also requires the API 30 of Android) has some changes that the user must estimate, so, probably for that reason Apache Cordova pick the previous version of Cordova Android and not the latest one. But in fact it's not a problem for us, I mean, what we call "force version" is not someting that "force" anything... in other words... what we do is to select the version to be used.



Tinn Aphopchung
Hi,David. Yes,It true like that.Because cordova.lib select ^9.1.0 to use.And the lastest template will be bug with API 30 (cause whitelist block).They remove cordova-plugin-whitelist that will be cause bug in AB. to fix it.if it compile with cordova android 9.1.0.cordova-plugin-whitelist plugin need to add manual. ref https://cordova.apache.org/news/2021/10/31/template-release.html

decsoft

Hello Tinn,

Certainly, a couple of releases ago I remove the whitelist plugin, which is no more required with the latest versions of Apache Cordova. If I am not wrong... I mention in the program's history file that that plugin is required if we are using a previous version of Apache Cordova. Since I am always use the latest version of Apache Cordova I take that way... but it's good to know that certainly we may need to add the whitelist plugin if we still in a previous version of Apache Cordova.



Tinn Aphopchung
For my solution,I force to use cordova android 10.1.1.(dunno why cordova alway select 9.1.0 as a latest version. )

decsoft

Hello Tinn,

Yes; that's the version which I use in my apps too, and, probably the recommended one if we are talking about new apps.



decsoft

Hello Tinn,

This can be useful to you: in the Cordova version option of the Android platform and the Cordova version option of the iOS platform, as you already know, we can specify the number of the version of Cordova Android and Cordova iOS that we want to use, but, it's also possible to set that options with the word "latest" (without quotes), and, this apparently works as expected, I mean, with this we are "forcing" to use the latest available versions of Cordova Android and Cordova iOS. This can be useful if we always want to use the latest versions, without update these options with the latest available version numbers. In fact this the "latest" option is well documented in Apache Cordova, but I simply forget to comment it here in this post.



Tinn Aphopchung
Great,David. Thank you.

Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.