So I recently hired the Indy plan, my app uses cordova 11 + sencha and I need to build it to ios too. One thing I noticed is that after cordova 9 most of the plugins information goes to package.json and not config.xml so because of that when I upload the zip files my plugins are not being installed. Is there a procedure or orientation on how to do this?
If you’re using cordova-11, make sure you have this line in your config.xml:
<engine name="android" spec="10.1.1" />
Thanks for the update, I already have this line. The problem was the all the info about the installed plugins are at package.json not config.xml, so I tried adding them manually and I had some problems:
1 - FileTransfer plugin, I saw the tutorial about the cordova 11 update about so its fine.
2 - Cant build with barcodescanner plugin and camera-preview there an error at the Manifest.xml because they both try to add android.hardware.camera and that causes a duplicate problem. I can build at my machine because I remove manually this line from the plugin so its not duplicated.
3 - cordova-plugin-http you guys use the original version which is not mine that includes the timeout function and postJson (my version: GitHub - miki95/cordova-HTTP: Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!)
4 - cordova-plugin-fileopener although its on the approved list it seems its under review something like this.
Sorry for any grammar errors, i’m not a native speaker.
-
I could use more information. What are the exact names of the plugins? What error do you get?
-
Plugins are referenced by their npm entry, so if you ask for cordova-plugin-http, you will get this plugin.
-
cordova-plugin-fileopener is now on the Approved List.
…thanks for the reply! I try to explain a little better:
In the config.xml file I include only the following plugins:
plugin name=“cordova-plugin-splashscreen” source=“npm” spec="~6.0.0"
plugin name=“cordova-plugin-ble-central” source=“npm” spec="~1.3.1"
After compiling in the androidmanifest.xml it generates the following permissions:
uses-permission android:name=“android.permission.INTERNET”
uses-permission android:name=“android.permission.ACCESS_COARSE_LOCATION”
uses-permission android:name=“android.permission.ACCESS_FINE_LOCATION”
uses-permission android:name=“android.permission.ACCESS_BACKGROUND_LOCATION”
uses-permission android:name=“android.permission.BLUETOOTH”
uses-permission android:name=“android.permission.BLUETOOTH_ADMIN”
Of these 6 permissions I only need:
uses-permission android:name=“android.permission.ACCESS_FINE_LOCATION”
uses-permission android:name=“android.permission.BLUETOOTH”
uses-permission android:name=“android.permission.BLUETOOTH_ADMIN”
How can I remove the permissions I don’t need, before or after aab is compiled?
Read and try this: https://www.npmjs.com/package/cordova-custom-config
Thanks a lot! I’m going to try it but I think it’s the solution!
2 - Plugins: phonegap-plugin-barcodescanner with cordova-plugin-camera-preview error log:
> Task :app:processDebugMainManifest FAILED
/platforms/android/app/src/main/AndroidManifest.xml:46:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:46:5-84 duplicated with element declared at AndroidManifest.xml:24:5-85
/platforms/android/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
I tried using the cordova-custom-config to remove the duplicate with this:
<platform name="android">
...
<custom-preference delete="true" name="android-manifest/uses-feature[@android:name='android.hardware.camera']" />
</platform>
but it did not worked.
- I changed to to advanced-http plugin
- I saw thks
- I made a simple project with phonegap-plugin-barcodescanner with cordova-plugin-camera-preview. It built properly.
Could the problem is something else?
Can you try with cordova camera plugin too? I have these three installed
I tried some variations and I always get the error when I put the camerapreview plugin. What version have you installed? I’m using 0.12.3
I got a clean build with camera + camerapreview; camera + barcodescanner but always get an error if I have both camerapreview and barcodescanner
Hello, It’s a real shame but apparently cordova-custom-config WILL NOT WORK with remote “Cloud” build environments that do not support the execution of this plugin’s hook scripts…
@rafael - cordova-custom-config is approved for use with VoltBuilder. We checked out the hooks it uses and they are fine for us.
@lbssouza - I am now able to reproduce this. It’s a known problem with the Preview plugin.
Unfortunately, it dates back to 2020, so it doesn’t look like is it being fixed. Last update to the plugin was August 2021. You might try contacting the author.
Otherwise, you’ll need to find another plugin.
I will try another one, thats the last problem i’m facing to use your service
I changed the barcodescanner plugin, since i couldn’t find another camerapreview plugin and it worked with cordova-plugin-barcodescanner instead of phonegap-plugin-barcodescanner