2012-06-08 125 views
-3

登錄貓:錯誤「應用程序已意外停止」從我的Android應用程序

06-08 22:10:24.930: E/Zygote(32): setreuid() failed. errno: 2 
    06-08 22:10:39.451: E/Zygote(32): setreuid() failed. errno: 17 
    06-08 22:10:41.590: E/BatteryService(61): usbOnlinePath not found 
    06-08 22:10:41.600: E/BatteryService(61): batteryVoltagePath not found 
    06-08 22:10:41.600: E/BatteryService(61): batteryTemperaturePath not found 
    06-08 22:10:41.610: E/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 
    06-08 22:10:41.860: E/SensorService(61): couldn't open device for module sensors (Invalid argument) 
    06-08 22:10:50.050: E/System(61): Failure starting core service 
    06-08 22:10:50.050: E/System(61): java.lang.SecurityException 
    06-08 22:10:50.050: E/System(61): at android.os.BinderProxy.transact(Native Method) 
    06-08 22:10:50.050: E/System(61): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 
    06-08 22:10:50.050: E/System(61): at android.os.ServiceManager.addService(ServiceManager.java:72) 
    06-08 22:10:50.050: E/System(61): at com.android.server.ServerThread.run(SystemServer.java:206) 
    06-08 22:10:50.090: E/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter 
    06-08 22:10:50.090: E/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter 
    06-08 22:10:50.700: E/SoundPool(61): error loading /system/media/audio/ui/Effect_Tick.ogg 
    06-08 22:10:50.710: E/SoundPool(61): error loading /system/media/audio/ui/KeypressStandard.ogg 
    06-08 22:10:50.720: E/SoundPool(61): error loading /system/media/audio/ui/KeypressSpacebar.ogg 
    06-08 22:10:50.730: E/SoundPool(61): error loading /system/media/audio/ui/KeypressDelete.ogg 
    06-08 22:10:50.740: E/SoundPool(61): error loading /system/media/audio/ui/KeypressReturn.ogg 
    06-08 22:10:50.790: E/UsbObserver(61): java.lang.NullPointerException 
    06-08 22:10:50.790: E/UsbObserver(61): at com.android.server.UsbObserver.init(UsbObserver.java:131) 
    06-08 22:10:50.790: E/UsbObserver(61): at com.android.server.UsbObserver.<init>(UsbObserver.java:65) 
    06-08 22:10:50.790: E/UsbObserver(61): at com.android.server.ServerThread.run(SystemServer.java:402) 
    06-08 22:10:52.010: E/ThrottleService(61): Could not open GPS configuration file /etc/gps.conf 
    06-08 22:10:53.540: E/logwrapper(154): executing /system/bin/tc failed: No such file or directory 
    06-08 22:10:53.660: E/logwrapper(155): executing /system/bin/tc failed: No such file or directory 
    06-08 22:10:53.740: E/logwrapper(158): executing /system/bin/tc failed: No such file or directory 
    06-08 22:11:30.560: E/Database(320): Failure 1 (near "(": syntax error) on 0x29bd78 when preparing 'create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null);'. 
    06-08 22:11:30.610: E/AndroidRuntime(320): FATAL EXCEPTION: main 
    06-08 22:11:30.610: E/AndroidRuntime(320): java.lang.RuntimeException: Unable to start activity ComponentInfo{poo.sushie.ourproject/poo.sushie.ourproject.MyprojectActivity}: android.database.sqlite.SQLiteException: near "(": syntax error: create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.os.Handler.dispatchMessage(Handler.java:99) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.os.Looper.loop(Looper.java:123) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread.main(ActivityThread.java:3683) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at java.lang.reflect.Method.invokeNative(Native Method) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at java.lang.reflect.Method.invoke(Method.java:507) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at dalvik.system.NativeStart.main(Native Method) 
    06-08 22:11:30.610: E/AndroidRuntime(320): Caused by: android.database.sqlite.SQLiteException: near "(": syntax error: create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1763) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at poo.sushie.ourproject.MyDBAdaptera$DatabaseHelper.onCreate(MyDBAdaptera.java:88) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:126) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at poo.sushie.ourproject.MyDBAdaptera.open(MyDBAdaptera.java:41) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at poo.sushie.ourproject.MyprojectActivity.onCreate(MyprojectActivity.java:24) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
    06-08 22:11:30.610: E/AndroidRuntime(320): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 
    06-08 22:11:30.610: E/AndroidRuntime(320): ... 11 more 

回答

0

有一個錯誤在你SQL查詢語法:

create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 

它說創建表,但它從來沒有命名它。它應該是:

CREATE TABLE MyTableName (_id int ...) 
0

看到這一行

06-08 22:11:30.610: E/AndroidRuntime(320): Caused by: android.database.sqlite.SQLiteException: near "(": syntax error: create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 

它說你的SQLite查詢請檢查語法。我想你沒有給表名。

create table tablename

0

的錯誤就在這裏在logcat的輸出:

06-08 22:11:30.610: E/AndroidRuntime(320): java.lang.RuntimeException: Unable to start activity ComponentInfo{poo.sushie.ourproject/poo.sushie.ourproject.MyprojectActivity}: android.database.sqlite.SQLiteException: near "(": syntax error: create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 

它在抱怨你的SQL語法錯誤:您正在嘗試創建一個表,但是你不給這個表一個名字。

的語法是這樣的:create table <tablename> (....

0

這裏的問題是:

Caused by: android.database.sqlite.SQLiteException: near "(": syntax error: create table (_id integer primary key autoincrement, question text not null, a text not null, b text not null, c text not null, d text not null, answer text not null, subject text not null); 
相關問題