title: iOS app converted to Android with Apportable crashing on launch
body: <p>I am new to Apportable but used it convert an iOS game to Android. I got some warnings about undefined/uninititated variables but no errors after removing some ad network libraries. Also I was getting a lot of errors when I was using Xcode 5 so I switched to using Xcode 4.6 as suggested in the documentation.</p>
  
  <p>Finally the app compiled and the APK was pushed to the phone. But when I try to launch the app, the splashscreen shows up inverted (and it switches and stays inverted if I try to turn the phone) and then the app crashes.</p>
  
  <p>After</p>
  
  <pre><code>apportable debug
  </code></pre>
  
  <p>I got the following output</p>
  
  <pre><code>Success
  Install complete.
  Starting: Intent { cmp=com.interactive.Turtles/com.apportable.activity.VerdeActivity (has extras) }
  
  Failed to load one the Breakpoints files:
  /Users/sst/Documents/Xcode/Turtles4/Turtles.xcodeproj/xcuserdata/sst.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  /Users/sst/Documents/Xcode/Turtles4/Turtles.xcodeproj/xcuserdata/sst.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  
  Attaching to pid 6435
  executing am startservice --user 0 -a com.interactive.Turtles.GdbServerService --es command start --es gdbserver_name /data/data/com.interactive.Turtles/lib/gdbserver --ei gdbserver_port 5039 with workaround for devices with broken adb run-as
  Starting service: Intent { act=com.interactive.Turtles.GdbServerService (has extras) }
  895 KB/s (9488 bytes in 0.010s)
  GNU gdb (GDB) 7.5-https://github.com/apportable/gdb Jan  3 2014 13:47:56
  Copyright (C) 2012 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "--host=x86_64-apple-darwin12.4.0 --target=arm-elf-linux".
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;.
  warning: Could not load shared library symbols for 9 libraries, e.g. gralloc.msm8960.so.
  Use the "info sharedlibrary" command to see the complete listing.
  Do you need "set solib-search-path" or "set sysroot"?
  0x4007780c in epoll_wait () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libc.so
  $1 = 1
  $2 = 0
  Breakpoint 1 at 0x7ba8f918: file /Users/sst/Documents/Xcode/Turtles4/Turtles/main.m, line 11.
  Breakpoint 2 at 0x78e3df8c
  [New Thread 6468]
  [Switching to Thread 6468]
  
  Breakpoint 1, main (argc=2074697264, argv=0x1) at /Users/sst/Documents/Xcode/Turtles4/Turtles/main.m:11
  11  int main(int argc, char *argv[]) {
  (gdb) bt
  #0  main (argc=2074697264, argv=0x1) at /Users/sst/Documents/Xcode/Turtles4/Turtles/main.m:11
  #1  0x7ba95ee0 in _start_method () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #2  0x75d2a3dc in __start () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libv.so
  #3  0x7b6d7470 in Java_com_apportable_MainThread_nativeRun () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #4  0x40abc490 in dvmPlatformInvoke () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #5  0x40aecff6 in dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #6  0x40aeecaa in dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #7  0x40ac5924 in dvmJitToInterpNoChain () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #8  0x40ac5924 in dvmJitToInterpNoChain () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  (gdb) c
  Continuing.
  
  Breakpoint 2, 0x78e3df8c in objc_exception_throw () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libSystem.so
  (gdb) bt
  #0  0x78e3df8c in objc_exception_throw () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libSystem.so
  #1  0x794a0aa4 in -[NSException raise] () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #2  0x794a0ba0 in +[NSException raise:format:arguments:] () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #3  0x79932424 in -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libFoundation.so
  #4  0x7ba6893c in -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:] (self=0x79bc8440, _cmd=0x7bb9d9c9 &lt;L_OBJC_METH_VAR_NAME_34&gt;,
      depthFormat=0, pixelFormat=32856, sharegroup=0x0, multiSampling=0 '\000', requestedSamples=0)
      at /Users/sst/Documents/Xcode/Turtles4/Turtles/libs/cocos2d/Platforms/iOS/CCES2Renderer.m:70
  #5  0x7ba6b4d4 in -[CCGLView setupSurfaceWithSharegroup:] (self=0x75fdb530, _cmd=0x7bb9d925 &lt;L_OBJC_METH_VAR_NAME_11&gt;, sharegroup=0x0)
      at /Users/sst/Documents/Xcode/Turtles4/Turtles/libs/cocos2d/Platforms/iOS/CCGLView.m:187
  #6  0x7ba6afb0 in -[CCGLView initWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:] (self=0x75fdb530, _cmd=0x7bb9d8c2 &lt;L_OBJC_METH_VAR_NAME_9&gt;,
      frame=..., format=0x7bbc98d0, depth=0, retained=0 '\000', sharegroup=0x0, sampling=0 '\000', nSamples=0)
      at /Users/sst/Documents/Xcode/Turtles4/Turtles/libs/cocos2d/Platforms/iOS/CCGLView.m:143
  #7  0x7ba6a878 in +[CCGLView viewWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:] (self=0x7bbc366c &lt;OBJC_CLASS_$_CCGLView&gt;,
      _cmd=0x7bb79a11 &lt;L_OBJC_METH_VAR_NAME_144&gt;, frame=..., format=0x7bbc98d0, depth=0, retained=0 '\000', sharegroup=0x0, multisampling=0 '\000', samples=0)
      at /Users/sst/Documents/Xcode/Turtles4/Turtles/libs/cocos2d/Platforms/iOS/CCGLView.m:120
  #8  0x7b6f48d0 in -[AppController application:didFinishLaunchingWithOptions:] (self=0x79b4dec0, _cmd=0x7bba23eb &lt;L_OBJC_METH_VAR_NAME_95&gt;, application=0x79b74700, launchOptions=0x0)
      at /Users/sst/Documents/Xcode/Turtles4/Turtles/AppDelegate.m:661
  #9  0x7ba96c38 in -[UIApplication finishedLaunching] () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #10 0x7ba97870 in __20_2D__5B_UIApplication_20_run_5D__block_invoke213 () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #11 0x78e53eec in _dispatch_call_block_and_release () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libSystem.so
  #12 0x78e53f08 in _dispatch_client_callout () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libSystem.so
  #13 0x78e56a68 in _dispatch_main_queue_callback_4CF () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libSystem.so
  #14 0x79438c14 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #15 0x79433fe0 in __CFRunLoopRun () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #16 0x79433630 in CFRunLoopRunSpecific () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #17 0x7943435c in CFRunLoopRunInMode () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libCoreFoundation.so
  #18 0x7998a710 in -[NSRunLoop(NSRunLoopConveniences) runMode:beforeDate:] () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libFoundation.so
  #19 0x7998a5bc in -[NSRunLoop(NSRunLoopConveniences) runUntilDate:] () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libFoundation.so
  #20 0x7ba97358 in -[UIApplication run] () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #21 0x7ba961e0 in UIApplicationMain () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #22 0x7ba8f998 in main (argc=1, argv=0x75f0d5f8) at /Users/sst/Documents/Xcode/Turtles4/Turtles/main.m:14
  #23 0x7ba95ee0 in _start_method () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #24 0x75d2a3dc in __start () from /Users/sst/.apportable/SDK/sysroot/android/armeabi/usr/lib/libv.so
  #25 0x7b6d7470 in Java_com_apportable_MainThread_nativeRun () from /Users/sst/.apportable/SDK/Build/android-armeabi-debug/Turtles/apk/lib/armeabi/libverde.so
  #26 0x40abc490 in dvmPlatformInvoke () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #27 0x40aecff6 in dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #28 0x40aeecaa in dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*) () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #29 0x40ac5924 in dvmJitToInterpNoChain () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  #30 0x40ac5924 in dvmJitToInterpNoChain () from /Users/sst/.apportable/cache/devices/dd5fa1e9/libs/libdvm.so
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  (gdb) c
  Continuing.
  [Inferior 1 (process 6435) exited normally]
  </code></pre>
  
  <p>Also, when I filtered out ADB logcat with the app name, this was shown when the app died</p>
  
  <pre><code>(standard input):10214:D/Turtles( 7047): 2014-02-21 15:09:40.312 Turtles[7047:2760] checkATPKEY : (null)
  (standard input):10215:W/Foundation( 7047): *** Assertion failure in -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:], /Users/sst/Documents/Xcode/Turtles4/Turtles/libs/cocos2d/Platforms/iOS/CCES2Renderer.m:70
  (standard input):10261:I/ActivityManager(  694): Process com.interactive.Turtles (pid 7047) (adj 0) has died.
  (standard input):10262:W/ActivityManager(  694): Force removing ActivityRecord{441c9b70 u0 com.interactive.Turtles/com.apportable.activity.VerdeActivity}: app died, no saved state
  </code></pre>
  
  <p>Looking at the debug output, the app is crashing at the main() call itself so can someone please help me find out why this may be happening?</p>
  
  <p>Thanks.</p>