cordova android has some issues and not sure how to solve it.
I have updated my cordova to the latest cordova#7.1.0 and my node to node8.2.0
but each time i try to build my ionic cordova project i get two errors
when i try to build my android project ionic cordova platform add android
Error: Source path does not exist: resources/android/icon/res/mipmap-hdpi/ic_launcher.png
Also when i try to run ionic cordova prepare i get the following error
Unable to load PlatformApi from platform. Error: Cannot find module '/platforms/browser/cordova/Api.js'
Error: Unhandled "error" event. (The platform "browser" does not appear to be a valid cordova platform. It is missing API.js. browser not supported.)
Kinda confused on these two errors and not sure how to solve them.
I am building an Ionic3 project.
Any help is appreciated
Related
I am trying to convert my angular app to andriod app using cordova
when issuing the command:
cordova build android
it gives the below error:
Unable to load PlatformApi from platform. Error: Cannot find module 'properties-parser'
Unhandled error. ('The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.')
what should I do ?
Removing and adding platform should work.
cordova platform rm android
cordova platform add android
Okay, so you run this. And it continues to fail.
cordova platform add android --save
And the output is this.
Error: Failed to fetch platform cordova-android#0.0.8
After trying to reinstall cordova, node, and other packages, I have had no luck. I am running this with the ionic blank starter package with ionic Cli 3.
For some reason with the latest version of everything, ionic, angular, the cli, etc, the platform was trying to add
cordova-android#0.0.8
To fix this, just go to this link and get the latest version, and run this...
sudo ionic cordova platform add android#6.4.0
I had the same issue and followed this link
https://github.com/apache/cordova-android/releases
There, I found that the latest version is 7.1.1
I tried this ionic cordova platform add android#7.1.1 but got the same error
From a forum I follow, I got this link https://www.npmjs.com/package/cordova-android
Then I tried this ionic cordova platform add android#7.1.0 and it ran as I expected
remove old android
ionic cordova platform rm android
add latest android
ionic cordova platform add android#latest
I checked out a Cordova project from SVN in IntelliJ Webstorm. When I try to run it on an emulated Android device, I receive the error message:
Error: Cannot find module './android_sdk'
All the other people working on the project can run the project fine. And I can run every project that I have created locally.
in my case (Kubuntu 16.04.2, Ionic 3.3.0, Cordova 7.0.1) i just did this:
cordova platform rm android
cordova platform add android
and that did the trick :)
I have build platform for android and ios at starting of the app.
I want to override android and ios build after some completion of the project.
command I'm using:
ionic platform build android
and it's giving error:
error: Platform "build" not recognized as as core cordova platform. See 'cordova platform list'.
I have tried even:
cordova platform build android
it's showing Available platforms. But apk file is not getting overridden.
What should I do to get a latest apk build output.
The build command is:
ionic build android
I am also facing this error but after uninstall all the ngCordova plugin and reinstall all, then i got No Error.
in continuation to MAC - Cordova error after installing Android Studio
On Mac os - Cordova project stopped working after installing Android Studio (4.4.1)
NOTE: it was working previous to the installation
I had some error when trying to do cordova build which
I managed to solved (see MAC - Cordova error after installing Android Studio)
but I'm still cannot run the project on the device.
I've installed the latest cordova (5.4.0) and when I'm running the project I get in logcat Uncaught TypeError: Cannot read property 'uuid' of undefined
the line code that fails is this.device_id = window.device.uuid;
this line was working previously so it seems that Cordova doesn't load properly.
any idea how to fix it?
The solution is:
cordova plugin remove org.apache.cordova.device
cordova plugin add org.apache.cordova.device
cordova prepare
then refresh the proj and run it (in eclipse)
than I add to delete the project from android studio and re-import it.
NOTE: you might also need to remove/add org.apache.cordova.console plugin