ionic 4 slow compile time - ionic-framework

My new Ionic projects take more than 100000ms everytime it compiles. tried it with multiple new project, all of them are extremely slow.
[ng] i 「wdm」: Compiling...
[ng] Date: 2018-10-09T13:28:58.064Z - Hash: 65e0e0d39e445c0b5c3b - Time: 106610ms
[ng] 173 unchanged chunks
[ng] chunk {home-home-module} home-home-module.js, home-home-module.js.map (home-home-module) 6.36 kB [rendered]
[ng] i 「wdm」: Compiled successfully.
Ionic version: 4.1.1
Node Version: 8.11.1

I had to upgrade to the current Node version (not the LTS version). That kind of solved the issue.

Related

fvm error Because flutter_tools depends on web_socket_channel 2.2.0 which doesn't match any versions - Flutter

I recently decided to start using FVM in flutter to manage my flutter versions. However, when I install a new version, this error that I show below occurs, leaving me in an eternal loop. Would anyone know what this is? My solution is that I end up downloading the version from the flutter website and manually placing it in the correct folder and it works. But I wanted to solve this problem and be able to install by line of code.
PS C:\Users\lucas> fvm install 3.3.10
Flutter "3.3.10" is not installed.
Installing version: 3.3.10...
Cloning into 'C:\Users\lucas\fvm\versions\3.3.10'...
remote: Enumerating objects: 421640, done.
remote: Counting objects: 100% (77/77), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 421640 (delta 33), reused 62 (delta 28), pack-reused 421563
Receiving objects: 100% (421640/421640), 232.47 MiB | 25.91 MiB/s, done.
Resolving deltas: 100% (321155/321155), done.
Updating files: 100% (6999/6999), done.
Updating files: 100% (2768/2768), done.
HEAD is now at 135454af32 CP: ci.yaml changes for packaging (#117133)
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine ...
Expanding downloaded archive...
Building flutter tool...
Running pub upgrade...
Because flutter_tools depends on web_socket_channel 2.2.0 which doesn't match any versions, version solving failed.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Running pub upgrade...
Because flutter_tools depends on web_socket_channel 2.2.0 which doesn't match any versions, version solving failed.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (8 tries left)
Running pub upgrade...
Because flutter_tools depends on web_socket_channel 2.2.0 which doesn't match any versions, version solving failed.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (7 tries left)

Could not open settings generic class file error when running flutter application

I am trying to run a new flutter project but then i get this error.
* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\techj\OneDrive\Desktop\EshopperApplication\eshopper_application\android\settings.gradle' (C:\Users\techj\.gradle\caches\7.4\scripts\ea4ydi90mwjg9g63m7r6nimmx).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63```
I am new to flutter can you please help me out
My gradle version
```------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 19.0.1 (Oracle Corporation 19.0.1+10-21)
OS: Windows 11 10.0 amd64
i was hopping the application would run as intended only to be flagged with this error..Spent a few hours doing some research but then i was hopping the problem would be with my gradle file or version but nothing seems to working for me.

Gradle takes long (40 seconds) even with no code change (flutter)

I use VS code and building a sample app. I have a 6-core AMD processor (FX-6300) with 32 GB RAM, and an SSD. I've just been unable to get builds fast.
This is my current gradle.properties file
org.gradle.jvmargs=-Xmx3096m -XX:+UseParallelGC -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
org.gradle.caching=true
org.gradle.daemon=true
org.gradle.vfs.watch=true
org.gradle.configureondemand=true
Even with no change building (F5: Start Debuging) the build takes 40 seconds.
gradlew --version shows
------------------------------------------------------------
Gradle 6.7
------------------------------------------------------------
Build time: 2020-10-14 16:13:12 UTC
Revision: 312ba9e0f4f8a02d01854d1ed743b79ed996dfd3
Kotlin: 1.3.72
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM: 15.0.2 (Oracle Corporation 15.0.2+7-27)
OS: Windows 10 10.0 amd64
Please help.
I have no idea what your code is or why its taking too much to build as you mention no info about .
But in case your building multiple projects adding org.gradle.parallel=true will help a lot .
And assuming your build will need org.gradle.jvmargs=-Xmx4096M then the next time all the details will be cached so it will spend less time to run , so giving more to org.gradle.jvmargs=-Xmx~ might help as well .
An increase in the memory size will help you to hold caches of your bigger build and thus improving the performance.

"ionic serve" gives error "Error: No module factory available for dependency type: ContextElementDependency"

I have been trying to do
ionic serve --address 127.0.0.1
all day with no luck due to the following error. Have been researching and investigating the issue for a long time now and hence this question here.
$ ionic serve
$ ng.cmd run app:serve --host=localhost --port=8100
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...
[INFO] Waiting for connectivity with ng...<br>
[INFO] Development server running!<br>
Local: http://localhost:8100
Use Ctrl+C to quit this process<br>
[INFO] Browser window opened to http://localhost:8100!<br>
[ng] i 「wdm」: wait until bundle finished: /
[ng] × 「wdm」: Error: No module factory available for dependency type: ContextElementDependency
[ng] at addDependency (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:398:12)
[ng] at iterationOfArrayCallback (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:80:3)
[ng] at addDependenciesBlock (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:414:5)
[ng] at iterationOfArrayCallback (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:80:3)
[ng] at addDependenciesBlock (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:417:5)
[ng] at Compilation.processModuleDependencies (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:425:4)
[ng] at afterBuild (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:552:16)
[ng] at _this.buildModule.err (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:598:11)
[ng] at callback (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:349:35)
[ng] at module.build.error (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:385:12)
[ng] at resolveDependencies (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\ContextModule.js:219:4)
[ng] at ContextModule.result.resolveDependencies (c:\Users\*******\Desktop\dev\app-name\node_modules\#ngtools\webpack\src\angular_compiler_plugin.js:517:25)
[ng] at ContextModule.build (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\ContextModule.js:148:8)
[ng] at Compilation.buildModule (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:353:10)
[ng] at factory.create (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\Compilation.js:579:15)
[ng] at hooks.afterResolve.callAsync (c:\Users\*******\Desktop\dev\app-name\node_modules\webpack\lib\ContextModuleFactory.js:150:16)
[ng] c:\Users\*******\Desktop\dev\app-name\node_modules\neo-async\async.js:16
[ng] throw new Error('Callback was already called.');
[ng] ^
[ng] Error: Callback was already called.
[ng] at throwError (c:\Users\*******\Desktop\dev\app-name\node_modules\neo-async\async.js:16:11)
[ng] at c:\Users\*******\Desktop\dev\app-name\node_modules\neo-async\async.js:2818:7
[ng] at process._tickCallback (internal/process/next_tick.js:61:11)<br><br>
[ERROR] ng has unexpectedly closed (exit code 1).<br><br>
The Ionic CLI will exit. Please check any output above for error details.
Other details
'ionic info' prints the following
Ionic:
Ionic CLI : 5.4.5 (C:\Users\******\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.11.4
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.3.9
#angular/cli : 7.3.9
#ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.13.0
OS : Windows 10
Hope I have shared sufficient information. Any help is appreciated. Thanks
Try to simulate following steps for the mentioned error.
Remove webpack from DevDependencies in Package.json file.
rm -R node_modules (To remove node_modules folder).
npm i -g webpack.
npm i -g webpack-dev-server.
remove package-lock.json file If it exists.
npm i(To install Node package again).
npm start (or ionic serve).

Ionic 3 App is not run on Android device

I can't run app on Android device it is not giving any error. Here is the output of terminal;
Running app-scripts build: --platform android --target cordova
[13:00:25] build dev started ...
[13:00:25] clean started ...
[13:00:25] clean finished in 24 ms
[13:00:25] copy started ...
[13:00:25] deeplinks started ...
[13:00:25] deeplinks finished in 130 ms
[13:00:25] transpile started ...
[13:00:31] transpile finished in 5.76 s
[13:00:31] preprocess started ...
[13:00:31] preprocess finished in 1 ms
[13:00:31] webpack started ...
[13:00:31] copy finished in 6.35 s
[13:00:41] webpack finished in 10.48 s
[13:00:41] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[13:00:44] sass finished in 2.45 s
[13:00:44] postprocess started ...
[13:00:44] postprocess finished in 19 ms
[13:00:44] lint started ...
[13:00:44] build dev finished in 19.37 s
> cordova run android
Android Studio project detected
ANDROID_HOME=C:\Users\umutg\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk-10
(node:3684) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Requirements check failed for JDK 1.8 or greater
(node:3684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
I think It does not see device, It does not work on another device or emulator. I create new app for trying it's same.
It's about JDK V 10, I uninstalled it and works fine.