Ionic 3.10.3 ERROR when i update - android

I update ionic 3.10.2 to 3.10.3 and i got this when i try build or something.
geen$ ionic serve
[INFO] Starting app-scripts server: --address 0.0.0.0 --port 8100
--livereload-port 35729 --dev-logger-port 53703 - Ctrl+C to cancel
[15:17:28] watch started ...
[15:17:28] build dev started ...
[15:17:28] clean started ...
[15:17:28] clean finished in 1 ms
[15:17:28] copy started ...
[15:17:28] transpile started ...
[15:17:30] transpile finished in 1.99 s
[15:17:30] preprocess started ...
[15:17:30] deeplinks started ...
[15:17:30] deeplinks finished in 22 ms
[15:17:30] preprocess finished in 22 ms
[15:17:30] webpack started ...
[15:17:30] copy finished in 2.09 s
If i type ionic serve or ionic cordova build android or ionic cordova run android -c -l to debug in my phone I get the same print.

I found the error. When you have in a component more than one class in the same .ts file ionic don't print the error but at the same time doesn't compile.

Related

ionic unable to create an APK [duplicate]

i am new to ionic, trying to get an apk for debugging i used the following commands inside the project directory:
ionic cordova platform add android
i did get "platforms/android" directory
and then i used:
ionic cordova build android
this is what i get after:
ionic-app-scripts build --target cordova --platform android
[23:57:19] ionic-app-scripts 3.1.10
[23:57:19] build dev started ...
[23:57:19] clean started ...
[23:57:19] clean finished in 10 ms
[23:57:19] copy started ...
[23:57:19] deeplinks started ...
[23:57:19] deeplinks finished in 36 ms
[23:57:19] transpile started ...
[23:57:27] transpile finished in 8.13 s
[23:57:27] preprocess started ...
[23:57:27] preprocess finished in less than 1 ms
[23:57:27] webpack started ...
[23:57:28] copy finished in 8.97 s
[23:57:35] webpack finished in 7.63 s
[23:57:35] 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.
[23:57:40] sass finished in 4.83 s
[23:57:40] postprocess started ...
[23:57:40] postprocess finished in 28 ms
[23:57:40] lint started ...
[23:57:40] build dev finished in 20.79 s
[23:57:44] lint finished in 3.91 s
> cordova build android
You have been opted out of telemetry. To change this, run: cordova telemetry on.
Android Studio project detected
(node:12696) UnhandledPromiseRejectionWarning: CordovaError: Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
at C:\Users\h2001\Desktop\myApp\platforms\android\cordova\lib\check_reqs.js:305:19
at _fulfilled (C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:816:13)
at C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:877:14
at runSingle (C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (C:\Users\h2001\Desktop\myApp\platforms\android\cordova\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
(node:12696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12696) [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.
but i didn't get the promised \build\outputs\apk, what is the problem?
UPDATE: i installed android studio and updated it, still getting
(node:12696) UnhandledPromiseRejectionWarning
UPDATE: the problem was solved, turns out i had java10 which wont work with android, simply installing java8 solved the problem
btw, i dont have android sdk installed if that makes any difference?
You have answered your own question.
To make an Android APK
You need Java SDK 1.8.
Android SDK with latest build tools and platforms
JAVA_HOME & ANDROID_HOME environmental variables set correctly.
Also You need updated X-Code on a Mac to create an IPA.
You probably doesn't have android environment variable in your PC.
if you are running MAC try running:
sudo export ANDROID_HOME=/<installation location>/android-sdk-macosx
sudo export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
If you are running Linux then:
export ANDROID_HOME=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
And if you are running Windows then open your command prompt as Administrator and run:
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
It will add enviroment variable to your system.

Ionic hang when run ionic serve and error at lint finished in 5.98 s

this is when i run ionic serve, and hang at lint finished
C:\workspace\myApp (master -> origin)
λ ionic serve
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[17:59:25] watch started ...
[17:59:25] build dev started ...
[17:59:25] clean started ...
[17:59:25] clean finished in 16 ms
[17:59:25] copy started ...
[17:59:26] copy finished in 670 ms
[17:59:26] deeplinks started ...
[17:59:26] deeplinks finished in 28 ms
[17:59:26] transpile started ...
[17:59:37] transpile finished in 11.26 s
[17:59:37] preprocess started ...
[17:59:37] preprocess finished in 2 ms
[17:59:37] webpack started ...
[17:59:48] webpack finished in 11.52 s
[17:59:48] 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.
[17:59:51] sass finished in 2.90 s
[17:59:51] postprocess started ...
[17:59:51] postprocess finished in 33 ms
[17:59:51] lint started ...
[17:59:51] build dev finished in 26.60 s
[17:59:52] watch ready in 27.00 s
[17:59:52] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://10.100.95.80:8100
DevApp: myApp#8100 on DESKTOP-9D89Q03
[17:59:57] lint finished in 5.12 s
hang after that
this is my ionic info
λ ionic info
cli packages: (C:\Users\NgimpiModol\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
local packages:
#ionic/app-scripts : 3.1.8
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.4
npm : 5.6.0
OS : Windows 10
but the project is run at browser google chrome, please help me...
Can you specify what exactly you mean with "it hangs after lint finished"? That just means that the Development Server is up and running and you should be good to go. Is livereload not working?

ionic 3 - UnhandledPromiseRejectionWarning when generating android build

I am using ionic 3.19 and when I try to create an android build it has the following error. With ios its fine. What is this problem and how to solve this ?
I am using node v8.9.1.
(node:49779) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES
Here is the execution and the problem output
$ ionic cordova build android --release
Running app-scripts build: --platform android --target cordova
[18:01:13] build dev started ...
[18:01:13] clean started ...
[18:01:13] clean finished in 6 ms
[18:01:13] copy started ...
[18:01:13] deeplinks started ...
[18:01:13] deeplinks finished in 97 ms
[18:01:13] transpile started ...
[18:01:17] transpile finished in 4.06 s
[18:01:17] preprocess started ...
[18:01:17] preprocess finished in less than 1 ms
[18:01:17] webpack started ...
[18:01:17] copy finished in 4.30 s
[18:01:25] webpack finished in 7.47 s
[18:01:25] 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.
[18:01:26] sass finished in 1.26 s
[18:01:26] postprocess started ...
[18:01:26] postprocess finished in 13 ms
[18:01:26] lint started ...
[18:01:26] build dev finished in 13.04 s
> cordova build android --release
ANDROID_HOME=/Users/megasap/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home
(node:49779) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES
(node:49779) [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.
[18:01:29] tslint: src/pages/attandance-detail/attandance-detail.ts, line: 175
'marker' is declared but never used.
L174: console.log(location)
L175: let marker = new google.maps.Marker({
L176: position: location,
[18:01:29] tslint: src/pages/home/home.ts, line: 260
'marker' is declared but never used.
L259: addMarker(location, map) {
L260: let marker = new google.maps.Marker({
L261: position: location,
[18:01:29] lint finished in 3.00 s
UPDATE:
This is the execution and error with node v9.4.0. This has a bit more detail than the previous running on node v8.9.1.
https://gist.github.com/axilaris/4cc7094c7dae28477eb2f348e53fad91
this did the trick!
sudo chmod 777 /Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin/gradle
I just had this problem and after updating Android Studio and it updated gradle from 4.1 to 4.4 then I had to update my environment variable and go to the new gradle location /opt/android-studio/gradle/gradle-4.4/bin and do chmod 777 gradle

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES Ionic 3

I 've been working on this issue for a lot of time and I can't really fix it. When I do ionic Cordova build android it works well until it gets to Cordova build android, anyone has some idea about what happened here??
I know that if a problem with permission but I can't found what is the directory I'd change
KENRYMAC:RecipeBookApp Kenry$ ionic cordova build android
Running app-scripts build: --platform android --target cordova
[23:36:09] build dev started ...
[23:36:10] clean started ...
[23:36:10] clean finished in 5 ms
[23:36:10] copy started ...
[23:36:10] deeplinks started ...
[23:36:11] deeplinks finished in 161 ms
[23:36:11] transpile started ...
[23:36:51] transpile finished in 40.73 s
[23:36:51] preprocess started ...
[23:36:51] preprocess finished in 1 ms
[23:36:51] webpack started ...
[23:36:52] copy finished in 42.36 s
[23:37:20] webpack finished in 28.48 s
[23:37:20] sass started ...
Witout `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning
[23:37:23] sass finished in 2.94 s
[23:37:23] postprocess started ...
[23:37:23] postprocess finished in 17 ms
[23:37:23] lint started ...
[23:37:23] build dev finished in 73.84 s
> cordova build android
ANDROID_HOME=/Users/Kenry/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
(node:4570) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn EACCES
(node:4570) [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.
[23:37:31] tslint: src/pages/signin/signin.ts, line: 4
'FormControl' is declared but never used.
L4: import { FormControl, NgForm } from '#angular/forms';
[23:37:31] tslint: src/pages/signup/signup.ts, line: 4
'FormControl' is declared but never used.
L4: import { FormControl, NgForm } from '#angular/forms';
[23:37:31] lint finished in 8.22 s
Please, can anyone give me some clues?? Thank you
Run the following command:
cordova build android --verbose
You can get output something like this:
Running command: /usr/libexec/java_home
Command finished with error code 0: /usr/libexec/java_home
ANDROID_HOME=/Users/mj/phonegap/adt-bundle-mac-x86_64-20140321/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"
-p /Users/mj/EduceMobile/app/platforms/android wrapper -b /Users/mj/EduceMobile/app/platfo
rms/android/wrapper.gradle
Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
.....
.....
Note the line:
Running command: "/Applications/Android
Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle"
This shows that there is permission issue with the file /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle.
To fix the issue, give appropriate permission to that file so that it can be executable.
You can run the following command:
sudo chmod +x /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1/bin/gradle
This should solve the issue.
If apple push services certificate not displays in key chain
Quit keychain access
Right-click the .cer file (e.g. aps_production.cer)
Select Open With > Keychain access (default)

Ionic app is not running is android studio emulator

I cannot run my ionic app in android studio emulator. when i am using ionic run android. It shows
`
myApp1#0.0.1 ionic:build D:\workspace\cordova\myApp1
> ionic-app-scripts build
[12:45:20] ionic-app-scripts 2.0.2
[12:45:20] build dev started ...
[12:45:20] clean started ...
[12:45:20] clean finished in 5 ms
[12:45:20] copy started ...
[12:45:20] transpile started ...
[12:45:22] transpile finished in 1.93 s
[12:45:22] preprocess started ...
[12:45:22] deeplinks started ...
[12:45:22] deeplinks finished in 11 ms
[12:45:22] preprocess finished in 12 ms
[12:45:22] webpack started ...
[12:45:22] copy finished in 2.08 s
[12:45:27] webpack finished in 5.11 s
[12:45:27] sass started ...
[12:45:27] sass finished in 691 ms
[12:45:27] postprocess started ...
[12:45:27] postprocess finished in 6 ms
[12:45:27] lint started ...
[12:45:27] build dev finished in 7.78 s
[12:45:29] lint finished in 1.73 s
D:\workspace\cordova\myApp>
`
I am using cordova 5.0.0 and ionic 2.2.3. How it possible to run on emulator. I have tried for long time. So please help me.

Categories

Resources