dbankier / TiShadow

Quick Titanium previews across devices
http://tishadow.yydigital.com
Other
385 stars 122 forks source link

Appified app doesn't load #111

Closed FokkeZB closed 11 years ago

FokkeZB commented 11 years ago

I've appified an heavy Alloy app, including native modules, assets and such. This app won't load, but hang on the splash image. I've tried to filter out any relevant messages from the Android console:

09-03 12:56:40.357: I/TiRootActivity(5478): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
09-03 12:56:40.362: I/TiApplication(5478): (main) [4,4] Analytics have been disabled
09-03 12:56:40.442: I/dalvikvm-heap(5478): Grow heap (frag case) to 12.691MB for 1536016-byte allocation
09-03 12:56:40.507: D/Module(5478): Loading module: /api/TiShadow -> Resources/api/TiShadow.js
09-03 12:56:40.572: D/Module(5478): Loading module: /api/Log -> Resources/api/Log.js
09-03 12:56:40.582: D/Module(5478): Loading module: /api/Utils -> Resources/api/Utils.js
09-03 12:56:40.597: D/Module(5478): Loading module: /api/PlatformRequire -> Resources/api/PlatformRequire.js
09-03 12:56:40.597: D/dalvikvm(5478): Trying to load lib /data/data/com.housebattle/lib/libtiverify.so 0x428ac6c8
09-03 12:56:40.602: D/dalvikvm(5478): Added shared lib /data/data/com.housebattle/lib/libtiverify.so 0x428ac6c8
09-03 12:56:40.607: I/TiRootActivity(5478): (main) [0,0] checkpoint, on root activity resume. activity = com.housebattle.HouseBattleActivity@4291fe38
09-03 12:56:40.617: D/Module(5478): Loading module: /lib/underscore -> Resources/lib/underscore.js
09-03 12:56:40.692: D/Module(5478): Loading module: /api/Assert -> Resources/api/Assert.js
09-03 12:56:40.702: D/Module(5478): Loading module: /api/Spec -> Resources/api/Spec.js
09-03 12:56:40.707: D/Module(5478): Loading module: /lib/jasmine -> Resources/lib/jasmine.js
09-03 12:56:40.792: D/Module(5478): Loading module: /api/TiShadowReporter -> Resources/api/TiShadowReporter.js
09-03 12:56:40.802: D/Module(5478): Loading module: /api/JUnitXMLReporter -> Resources/api/JUnitXMLReporter.js
09-03 12:56:40.807: D/Module(5478): Loading module: /lib/socket.io -> Resources/lib/socket.io.js
09-03 12:56:40.897: D/Module(5478): Loading module: /api/Beach -> Resources/api/Beach.js
09-03 12:56:40.902: D/Module(5478): Loading module: /api/UI -> Resources/api/UI.js
09-03 12:56:40.907: D/Module(5478): Loading module: /api/Localisation -> Resources/api/Localisation.js
09-03 12:56:40.922: D/Module(5478): Loading module: /app -> Resources/app.js
09-03 12:56:41.037: D/WSProxy(5478): (KrollRuntimeThread) [433,433] * creating websocket
09-03 12:56:41.042: D/WSProxy(5478): (KrollRuntimeThread) [7,440] * creating websocket
09-03 12:56:41.062: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"INFO","message":"Previous bundle closed."}]} op: 1 err: -1
09-03 12:56:41.062: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"DEBUG","message":"Native module:/app"}]} op: 1 err: -1
09-03 12:56:41.067: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"INFO","message":"Previous bundle closed."}]} op: 1 err: -1
09-03 12:56:41.067: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"DEBUG","message":"Native module:/app"}]} op: 1 err: -1
09-03 12:56:41.067: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"INFO","message":"House Battle launched."}]} op: 1 err: -1
09-03 12:56:41.067: D/HybiParser(5478): Creating frame for: 5:::{"name":"log","args":[{"level":"INFO","message":"House Battle launched."}]} op: 1 err: -1
09-03 12:56:41.067: D/HybiParser(5478): Creating frame for: 5:::{"name":"join","args":[{"name":"android, 4.1.2, 192.168.0.105","uuid":"09628467-1a30-4f76-acf1-13b2ba613bba","os_osname":"android","os_version":"4.1.2","room":"default"}]} op: 1 err: -1
09-03 12:56:41.087: D/HybiParser(5478): Creating frame for: 5:::{"name":"join","args":[{"name":"android, 4.1.2, 192.168.0.105","uuid":"09628467-1a30-4f76-acf1-13b2ba613bba","os_osname":"android","os_version":"4.1.2","room":"default"}]} op: 1 err: -1

My attention was drawn in particular to lines 25 and 27, that seem to indicate it can't find the app.js in the packaged app and because of that tries to load it as a native module.

Also strange is seeing lines 25/27, 28/29 and 30/31 being duplicates, as though something is happening twice.

The packaged app is quite big (10Mb), so maybe it hasn't finished unzipping it or even fails doing so? But I don't see an error indicating this is the case. The zip extracts fine on my Mac and contains the required app.js.

dbankier commented 11 years ago

I had this when testing with the simulator. The zip in Resources was OK, but the zip that was in ~/Library/Application Support/iPhone Simulator/6.1/Applications/etc was not. I'm not sure if titanium cli is struggling during build or something else... I will look into this soonish.

FokkeZB commented 11 years ago

I was building the appified app to an Android device and the zip in /build/android/bin/assets/Resources is fine, so I'm afraid it's a different problem.

FokkeZB commented 11 years ago

The log for an iOS device is:

Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Reading stylesheet from: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/stylesheet.plist
Sep  3 14:26:03 iPhone-Fokke kernel[0] <Debug>: launchd[4771] Builtin profile: container (sandbox)
Sep  3 14:26:03 iPhone-Fokke kernel[0] <Debug>: launchd[4771] Container: /private/var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430 (sandbox)
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [INFO] House Battle/1.0 (3.1.2.GA.5ceaff8)
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/app.js, Resource: app_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/TiShadow.js, Resource: api/TiShadow_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Log.js, Resource: api/Log_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Utils.js, Resource: api/Utils_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [INFO] [object TiCompressionModule] loaded
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/ti.compression.js, Resource: ti_compression_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/PlatformRequire.js, Resource: api/PlatformRequire_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/lib/underscore.js, Resource: lib/underscore_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Assert.js, Resource: api/Assert_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Spec.js, Resource: api/Spec_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/lib/jasmine.js, Resource: lib/jasmine_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/TiShadowReporter.js, Resource: api/TiShadowReporter_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/JUnitXMLReporter.js, Resource: api/JUnitXMLReporter_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/lib/socket.io.js, Resource: lib/socket_io_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Beach.js, Resource: api/Beach_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/UI.js, Resource: api/UI_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Localisation.js, Resource: api/Localisation_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/api/Fonts.js, Resource: api/Fonts_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [INFO] [object YyTidynamicfontModule] loaded
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/yy.tidynamicfont.js, Resource: yy_tidynamicfont_js
Sep  3 14:26:03 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Application booted in 320.824027 ms
Sep  3 14:26:04 iPhone-Fokke House Battle[4771] <Warning>: [DEBUG] Loading: /var/mobile/Applications/8033CFEA-E6F2-4635-8984-954CE3CDC430/House Battle.app/net.iamyellow.tiws.js, Resource: net_iamyellow_tiws_js
dbankier commented 11 years ago

OK should be fixed now. Was a stupid mistake on my part. Makes sure you uninstall the appified app before retesting.