Ionic run android error - android

I just installed ionic but when I try ionic emulate android in the cmd window, I get the following error:
Error: ENOENT, no such file or directory > 'C:\Users...\myapp\plugins\com.ionic.keyboard\www\keyboard.js
I have tried deleting the project and creating a new one, uninstalling ionic and cordova and reinstalling them, amongst other attempts at fixing the problem and I have not had any success. I looked in the directory in the error message and everything is there until \www\keyboard.js. There is no www folder.
Also, I'm running windows 8. If anyone has any idea how to fix this I would really appreciate it. Thanks!

just create the "www" folder, and retry running ionic emulate android

Related

Cordova Web App

I'm trying to make an apk of the web app I made in babylonjs.
From my understanding you can use Cordova to convert a web app into an apk.
I was able to install Cordova and make its hello world apk download to my phone and open and run it just fine.
However my problem occurs when I put all of my web app files into the www folder in my Cordova project folder. After I do that Cordova gives me this error
Error: ENOENT: no such file or directory, stat '/Users/dylan/practiceApk/www/node_modules/.bin/nopt'
when I try to build the android version.
Here is some information about my setup I believe is relevant.
OS: Mac
cordova -v: 7.1.0
Cordova requirements:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-24
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
cordova info also gives this error(similar error I believe to the one above):
Error retrieving Android platform information:
Android SDK is not set up properly. Make sure that the Android SDK 'tools' and 'platform-tools' directories are in the PATH variable.
Error: android: Command failed with exit code ENOENT
But I tried a lot of different things to fix this. Most of them involved making the android tools in the path (er something..?) I also downgraded from the most recent version of Cordova and android. I believe the problem is in my web app node_modules/.bin/nopt
But I don't know why its is a problem.
Also im not sure how this affects it, but I'm not hosting the website anywhere I just assumed I can used Cordova to create the web app as an apk that could be used offline, all resource are in the project folder though.
Any ideas on how to fix this? I only started using Cordova today so I don't know much about it.
Thanks for your time!
Update: I tried building an iOS version and I get the same error. I believe this is an issue with my npm setup...
It seems that when I was copying over my project to the newly made Cordova project folder I also copied the node_modules folder and didn't actually initialize npm. After initializing it and then updating it would build the app.

phonegap build android => cant find apk with android 7.0.0

I tried to update android in an existing phonegap project, told me fetching 7.0.0 ... completed. when I list platforms, it told me 6.3.0 was installed. So I did
phonegap platform remove android
phonegap platform add android
and copied my jks into platforms/android again.
phonegap build android (--release) is both telling me:
[phonegap] executing 'cordova build android' ...
[phonegap] completed 'cordova build android --no-telemetry'
But I cant find my outputs folder. Neither in platforms/android/build (I only have folder "android-profile" with a json and a rowproto file for every build) nor in platforms/android/app/build (there are folders "intermediate" and "generated"). I already searched for android-release-unsigned.apk and app-release-unigned.apk - nothing found.
Anybody an idea where to search or find out why it isn't created although there are no errors?
Thanks in advance
The answer can be found by adding "-d" to the build command. Then phonegap gives detailed information on build problems. In my case it could not find google-services.json
I faced the same issue and found that the output directory has been changed from ..platforms\android\build to ..\platforms\android\app\build\outputs\apk\debug
You could check the above directory.

Unable to generate android apk file through Ionic Project

I recently buy one ionic project, i had tried a lot to generate APK file but unable to successful.
First i download the file and run cmd.goto the files directory.
i run the command ionic platform add android , bit it says
After Executing ionic platform add android
if i rename ionic.project to ionic.config.json and again execute ionic platform add android it says * Looks like a fresh checkout! No ./node_modules directory found. Would you like to install proj
ect dependencies?*
After installing npm i execute ionic build --release android but it does nothing and gives me warning
[WARN] Not performing Ionic build for project type: ionic1.
[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying .\bower.json.
Warning
Please help me out i am badly stuck.
Had the same problem after updating.
ionic lib update does not work if there is no www/lib/ionic.
You can create it though by copying manually from node_modules/ionic-sdk/release.
This removed the FILE_NOT_FOUND errors for me.

Cannot find module "./app.module.ngfactory"

I updated Ionic from RC1 to RC3 following the documentation instructions and after that I can't run my app properly in Android using ionic run android or ionic build android. Previewing with ionic serve and .apk build works properly, but when I run the app in my device or in an emulator, it shows the splashscreen and after a blank WebView. When I debug via chrome://inspect, it shows in console the following error:
main.js:7 Uncaught Error: Cannot find module "./app.module.ngfactory"
I made a backup of the project folder before the update, when my app was working properly, and the code is the same (no changes during the upgrade), and the app.module.ts, main.dev.ts and main.prod.ts seems fine.
I tried remove .tmp and node-modules folder and run npm install again, but the error persists.
check this out: https://forum.ionicframework.com/t/cannot-find-module-app-module-ngfactory/72832/3
The newest version of typescript caused the error for me.
In my case I had an import problem with NGTranslate.
See here Ionic Forum Post

Errors with setting up an Ionic app

I've just started to get my hands on the Ionic Framework to code my first Android app.
I can set up the project, but when I want to add the Android platform via 'ionic platform add' it says:
' ? Error reading config file: Error: ENOENT, open 'D:\Projects\android2\config.xml'
Error happened: undefined'
When I want to build the App via 'ionic build android' it says:
'Current working directory is not a Cordova-based project.'
When I run the fix from the ionic FAQ ('cordova create') it says:
'At least the dir must be provided to create new project. See `cordova help`.'
Does anyone know why this errors happen?
Edit: tried on multiple computer (Windows 7 64), got the same error.
Go inside the folder you will find another folder where you might be containing all the files related to your projects ,after going inside the folder write down the command 'ionic platform add android'...
For example:
step1: ionic start MyFirstApp blank
after running this command a folder will be created in which to the drive where you run.
step2: Go inside the folder name 'MyFirstApp' by running command 'cd MyFirstApp'
step3: Then write ionic platform add android
I think this will work for you! Happy Coding

Categories

Resources