Cordova not available

This post was flagged by the community and is temporarily hidden.

You didn’t mention where you are seeing this message. Is it in the log, or on an actual device?

On device there is no responding while clicking on scanner/ camera (related to native) options console was showing like
common.js:284 Native: tried calling QRScanner.prepare, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator.

There’s the answer: “Make sure to include cordova.js”

Your index.html file should have this in it:

<script src="cordova.js"></script>

“Ionic build” hasn’t added it to index.html, and when usage ‘volt’ to build for android debug apk, volt must add it to index.html? right?

You need to add the file yourself. VoltBuilder will not do it automatically (we don’t like the idea of modifying your source files)

Even if we add it to index.html the same issue persists. When we run platform based ionic build (ionic cordova build android) it will automatically added in to the index.html and www folder also will have “cordova.js” file and platform required files. Until this build app will not work as expected.
To making this we are with you. Can you please suggest to over come of (ionic cordova build android)?

We’ll have a look into this.

I just tried your project, adding this line to index.html:

<script src="cordova.js"></script>

The project seems to run properly on a device.

We will investigate whether we can add this automatically. In the meantime, you should be fine if you add the line yourself.

After uploading the zip to volt there is an server error responded.
Failed ServerError: Cordova build for android failed Checking for saved platforms that haven’t been added to the project Loaded API for android project /agent/upload/da9d0ff6-f389-4f06-8788-19b831e14a51/platforms/android/cordova/Api.js
and so on

Your index.html is still missing this line:

<script src="cordova.js"></script>

Also, have a look at your config.xml. Do you see this line?

<engine name="android" spec="~9.1.0" />

Change it to

<engine name="android" spec="9.1.0" />

We’ve updated VoltBuilder. It will now automatically add the cordova.js line and correct the engine spec if needed.

You should no longer need to make any change to your project.

When changed to

server responded with
UserError: Error: engine has invalid spec: ‘.1.0’.

Please try once more. That last error was on our end and now should be resolved.

Build success but “app not installed” on android device. All existing app or cache were cleared before installation.

Would you send me your apk? I’ll try it on a device here. You can send it to

I tried your apk on an Android device here - it installed and ran properly. It’s probably something with your device, not your apk.

Try removing any existing copies of your app and rebooting.