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.
No comments:
Post a Comment