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

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

Related

ionic cannot run app in android studio missing config and showing unresolved libraries

i'm using ionic and i try to run my app in android studio. On Ios everything is working fine but android studio is always saying please add configuration. I actually have no idea how to add a configuration. Also my project contains three packages. I'm building my project with the following commands:
ionic build
npx cap sync
npx cap open android
Also android studio cannot resolve some libraries.
Please find attached a screenshot of the errors i have mentioned above:
thank you
I had this same issue, and I think it was a few problems compounded. It looks like you shouldn't have to add configurations manually, so if the "app" configuration doesn't appear automatically then something is wrong. I ran
ionic cap build android
which built everything and launched android studio. If that doesn't fix it, you might be missing some sdks. Try running this command from your android folder.
./gradlew assembleDebug
Mine complained about missing a specific version of the android sdk which I had to install with the android studio sdk manager. Then I relaunched android studio, and the "app" configuration was there.

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.

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.

Ionic run android error

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

Netbeans IDE: Unknown error when running a Cordova project

Ok, I am having a real painful issue on Netbeans IDE 8.0. I have already installed Android SDK, GIT, Cordova and Node.js.
However, I tried to test an index.html sample page by clicking on "Run" above, and I got an unknown error (Refer to the attached screenshot here).
Why is this? Thank!

Categories

Resources