#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");//这行报错了
[pool release];
return retVal;
}
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to instantiate the UIApplication subclass instance. No class named NSApplication is loaded.'
*** First throw call stack:
(0x18426afe0 0x182ccc538 0x18426aeb4 0x184d0278c 0x18a620b10 0x18a401024 0x1000c6450 0x18315559c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Android报错如下
12-22 00:57:21.621: E/AndroidRuntime(24540): FATAL EXCEPTION: main
Process: com.wbget.test, PID: 24540
java.lang.RuntimeException: Unable to destroy activity {com.wbget.test/org.cocos2dx.javascript.AppAct
ivity}: java.lang.NullPointerException
at android.app.ActivityThread.performDestroyActivity(Activ
ityThread.java:3705)
at android.app.ActivityThread.handleDestroyActivity(Activi
tyThread.java:3723)
at android.app.ActivityThread.access$1500(ActivityThread.j
ava:162)
at android.app.ActivityThread$H.handleMessage(ActivityThre
ad.java:1319)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:538
7)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.
run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java
:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at org.cocos2dx.lib.Cocos2dxHelper.runOnGLThread(Cocos2dxH
elper.java)
at org.cocos2dx.lib.Cocos2dxAudioFocusManager.unregisterAu
dioFocusListener(Cocos2dxAudioFocusManager.java)
at org.cocos2dx.lib.Cocos2dxActivity.onDestroy(Cocos2dxAct
ivity.java)
at org.cocos2dx.javascript.AppActivity.onDestroy(AppActivi
ty.java)
at android.app.Activity.performDestroy(Activity.java:5603)
at android.app.Instrumentation.callActivityOnDestroy(Instr
umentation.java:1135)
at android.app.ActivityThread.performDestroyActivity(Activ
ityThread.java:3692)
... 11 more