Build.
1. gulp build
2. phonegap build android
Deploy with signed.
1. Open Android Studio.
2. Open Angular js project folder >> platforms >> android
3. Follow pics below.
Deploy to apk fails when unsigned.
http://stackoverflow.com/questions/20402818/build-android-release-apk-on-phonegap-3-x-cli/22979830#22979830
Wednesday, 11 November 2015
How to install Android emulator on MAC
Follow this link to install Android SDK
http://www.petefreitag.com/item/763.cfm
Change $PATH to run sdk anywhere
http://stackoverflow.com/questions/5526470/trying-to-add-adb-to-path-variable-osx
http://hathaway.cc/post/69201163472/how-to-edit-your-path-environment-variables-on-mac
When I do below, I got error complaining
phone gap build android
I found a solution here.
http://stackoverflow.com/questions/29396252/cordova-error-please-install-android-target-android-21
You should change target in 3 places.
Then phone gap build android starts working.
http://www.petefreitag.com/item/763.cfm
Change $PATH to run sdk anywhere
http://stackoverflow.com/questions/5526470/trying-to-add-adb-to-path-variable-osx
http://hathaway.cc/post/69201163472/how-to-edit-your-path-environment-variables-on-mac
When I do below, I got error complaining
phone gap build android
[Error: Please install Android target: "android-22".
I found a solution here.
http://stackoverflow.com/questions/29396252/cordova-error-please-install-android-target-android-21
You should change target in 3 places.
Then phone gap build android starts working.
Sunday, 8 November 2015
phonegap build android - error
After doing Angular js coding for a while, suddenly, the below line didn't work.
phonegap build android
How I bang my head on wall
The build command returned error. iOS was working fine. But phonegap run android returned broken pages and WEB API returned nothing.
I removed android platform and added again. Didn't help.
I installed phonegap again with latest. Didn't help
I started deleting entire www folder. Because I thought 'gulp build' makes whole www again. I was wrong!!!
The icon in res\redrawable-hd folder generated and deleted.
At one stage, I thought the above was this error in below link. But it wasn't.
http://javalearnersproblems.blogspot.com.au/2011/11/androidmanifestxml-has-error-no.html
Then I found I am missing folders and files under www. See how js folder only is regenerated when you run 'gulp build'.
The error below is irrelevant. I don't know what it means. Maybe my index.html had problem.
I have copied some of my head banging cmd dump in this HTML file. Look at the red color lines.
Solution
I found that after 'phonegap build android', actually the error message shows 'FAIL' at first time, complaining about 'administrator's Macbook's index.html'. What the xxx?? I found that that strange file exists in www folder. It must be generated while I was doing some copy/paste.
1. I deleted that file.
2. gulp build
3. phonegap build android
=> platforms, androidManifest.xml etc is generated. I guess. Emulator is not refreshing without build.
4. phonegap run android.
All worked good!
See the 'Other' text shows on top? That's from web api!!!
After a few days later ...
When I worked well in iOS for a while and came back to windows for Android test, it started showing error again when I 'phonegap build android'. The error message was ..
C:\Users\matthew.oh\Dropbox\my-app\angularui\platforms\android\AndroidManifest.xml:27:9 Error:
Element service#com.adobe.phonegap.push.GCMIntentService at AndroidManifest.xml:27:9 duplicated with element declared at AndroidManifest.xml:19:9
FAILED
It complained about GCM push something.
This is what I did to fix it.
1. phonegap platforms remove android
2. phonegap platforms add android
3. phonegap plugin remove phonegap-plugin-push
4. phonegap plugin add phonegap-plugin-push
5. gulp build
6. phonegap build android
Then it was ok.
phonegap build android
How I bang my head on wall
The build command returned error. iOS was working fine. But phonegap run android returned broken pages and WEB API returned nothing.
I removed android platform and added again. Didn't help.
I installed phonegap again with latest. Didn't help
At one stage, I thought the above was this error in below link. But it wasn't.
http://javalearnersproblems.blogspot.com.au/2011/11/androidmanifestxml-has-error-no.html
Then I found I am missing folders and files under www. See how js folder only is regenerated when you run 'gulp build'.
The error below is irrelevant. I don't know what it means. Maybe my index.html had problem.
I have copied some of my head banging cmd dump in this HTML file. Look at the red color lines.
Solution
I found that after 'phonegap build android', actually the error message shows 'FAIL' at first time, complaining about 'administrator's Macbook's index.html'. What the xxx?? I found that that strange file exists in www folder. It must be generated while I was doing some copy/paste.
1. I deleted that file.
2. gulp build
3. phonegap build android
=> platforms, androidManifest.xml etc is generated. I guess. Emulator is not refreshing without build.
4. phonegap run android.
All worked good!
See the 'Other' text shows on top? That's from web api!!!
After a few days later ...
When I worked well in iOS for a while and came back to windows for Android test, it started showing error again when I 'phonegap build android'. The error message was ..
C:\Users\matthew.oh\Dropbox\my-app\angularui\platforms\android\AndroidManifest.xml:27:9 Error:
Element service#com.adobe.phonegap.push.GCMIntentService at AndroidManifest.xml:27:9 duplicated with element declared at AndroidManifest.xml:19:9
FAILED
It complained about GCM push something.
This is what I did to fix it.
1. phonegap platforms remove android
2. phonegap platforms add android
3. phonegap plugin remove phonegap-plugin-push
4. phonegap plugin add phonegap-plugin-push
5. gulp build
6. phonegap build android
Then it was ok.
Thursday, 29 October 2015
ADFS Login Process
Refer to Doc, how to copy ADFS from Neil.
No1 is required to make javascript to point the correct value.
Without No2, there was 'dangerous ...' error.
Without No3, there was error.
Web.config should be different from local and live.
When login button is clicked, it goes to correct login screen.
Tuesday, 20 October 2015
Angular JS compile in iOS/Android
Angular JS compile in iOS
1. go to your app-folder
2. gulp build
3. phonegap build ios
4. go to Xcode
5. connect / run to your phone
No2 creates www folder (Phonegap folder) from src folder (Angular JS code)
No3 creates app-folder\platforms\ios\XXX.xcodeproj
Angular JS compile in Android
1. go to your app-folder
Never do below!! (Some of the files in www are essentially necessary eg, icon.png. And they do not recover by 'gulp build')
2. cd www
del *
cd ..
3. gulp build
4. phonegap build android
(build was necessary to run emulator properly)
5. phonegap run android
1. go to your app-folder
2. gulp build
3. phonegap build ios
4. go to Xcode
5. connect / run to your phone
No2 creates www folder (Phonegap folder) from src folder (Angular JS code)
No3 creates app-folder\platforms\ios\XXX.xcodeproj
Angular JS compile in Android
1. go to your app-folder
Never do below!! (Some of the files in www are essentially necessary eg, icon.png. And they do not recover by 'gulp build')
3. gulp build
4. phonegap build android
(build was necessary to run emulator properly)
5. phonegap run android
Monday, 19 October 2015
Subscribe to:
Posts (Atom)
































