项目在不同的设备中运行不同

时间:2015-10-06 06:48:23

标签: android performance android-activity android-version

在处理我的项目时,意识到我的一些选项存在问题。

in this quastion 我向您展示了我在项目中的一个选项是如何崩溃的。然后我意识到它在其他一些设备上工作。我试图找出问题是否是我的项目的版本,但它不是。 我拿了两部完全相同的LG g3手机,它只用了一部,而另一部则崩溃了。

可能是什么问题?

p.s,出于某种原因,我的所有项目看起来都很旧(按钮的设计和编辑文本的外观来自真正的旧版Android)。

编辑:

发布了我的错误日志

10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime: Process: com.example.hay.myapplication, PID: 1650
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hay.myapplication/com.example.hay.myapplication.UserCreatingActivity}: java.lang.NullPointerException: Attempt to get length of null array
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.access$800(ActivityThread.java:148)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5274)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:  Caused by: java.lang.NullPointerException: Attempt to get length of null array
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.content.res.AssetManager.getResourceTextArray(AssetManager.java:235)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.content.res.Resources.getTextArray(Resources.java:479)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.widget.ArrayAdapter.createFromResource(ArrayAdapter.java:430)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at 

com.example.hay.myapplication.UserCreatingActivity.onCreate(UserCreatingActivity.java:46)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:5977)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2258)
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.access$800(ActivityThread.java:148) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5274) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) 
10-06 09:55:00.378 1650-1650/com.example.hay.myapplication E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 
10-06 09:55:00.436 1100-1462/? E/WifiStateMachine:  ConnectedState !CMD_RSSI_POLL 2241 0 "HackerU_Student" 5c:a4:8a:4d:4b:bf rssi=-61 f=5220 sc=60 link=150 tx=10.5, 0.0, 0.0  rx=331.8 bcn=0 [on:0 tx:0 rx:0 period:3001] from screen [on:0 period:1005488979] gl rssi=-61 ag=0 ticks 0,0,34 ls-=0 [56,56,60,60,60] brc=0 lrc=0
10-06 09:55:00.436 1100-1462/? E/WifiStateMachine:  L2ConnectedState !CMD_RSSI_POLL 2241 0 "HackerU_Student" 5c:a4:8a:4d:4b:bf rssi=-61 f=5220 sc=60 link=150 tx=10.5, 0.0, 0.0  rx=331.8 bcn=0 [on:0 tx:0 rx:0 period:1] from screen [on:0 period:1005488980] gl rssi=-61 ag=0 ticks 0,0,34 ls-=0 [56,56,60,60,60] brc=0 lrc=0
10-06 09:55:00.563 15624-15624/? E/SessionManagerService: X = 1440 Y = 2560 Orientation = 1
10-06 09:55:00.652 6649-6672/? E/SQLiteLog: (2067) abort at 35 in [INSERT INTO context(context_name,end_time,context_family,module_id,version,sync_state_mod_time_millis,start_time,sync_state,context_id,time_type,proto_blob) VALUES (?,?,?,?,?,?,?,?,?,?,?)]: UNI
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase: Error inserting context_name=8 end_time=1444114500569 context_family=7 module_id=com.google.android.contextmanager.module.PowerConnectionModule version=1 sync_state_mod_time_millis=1444114500651 start_time=1444114427560 sync_state=0 context_id=3995b854-6956-430c-9226-592ae97959dd time_type=3 proto_blob=[B@327839e9
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: context.context_id (code 2067)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:787)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:926)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1572)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1442)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.q.al.a(SourceFile:408)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.q.al.b(SourceFile:383)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.q.al.a(SourceFile:349)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.q.al.b(SourceFile:376)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.g.a.j.a(SourceFile:58)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.g.a.a.run(SourceFile:52)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at com.google.android.contextmanager.g.i.handleMessage(SourceFile:215)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.os.Looper.loop(Looper.java:135)
10-06 09:55:00.692 6649-6672/? E/SQLiteDatabase:     at android.os.HandlerThread.run(HandlerThread.java:61)
10-06 09:55:00.988 15624-15624/? E/SessionManagerService: X = 2560 Y = 1440 Orientation = 2
10-06 09:55:02.508 23896-23896/? E/b: Unable to connect to the editor to retrieve text... will retry later
10-06 09:55:02.613 324-358/? E/GBMv2: DFP En is all cleared set to be enabled
10-06 09:55:02.613 324-358/? E/GBMv2: Set value is all cleared set the max
10-06 09:55:03.414 15619-15674/? E/audio_hw_primary: disable_snd_device: enter 2
10-06 09:55:03.451 1100-1462/? E/WifiStateMachine:  ConnectedState !CMD_RSSI_POLL 2241 0 "HackerU_Student" 5c:a4:8a:4d:4b:bf rssi=-63 f=5220 sc=60 link=150 tx=5.2, 0.0, 0.0  rx=325.9 bcn=0 [on:0 tx:0 rx:0 period:3001] from screen [on:0 period:1005491995] gl rssi=-63 ag=0 ticks 0,0,35 ls-=0 [56,56,60,60,60] brc=0 lrc=0
10-06 09:55:03.452 1100-1462/? E/WifiStateMachine:  L2ConnectedState !CMD_RSSI_POLL 2241 0 "HackerU_Student" 5c:a4:8a:4d:4b:bf rssi=-63 f=5220 sc=60 link=150 tx=5.2, 0.0, 0.0  rx=325.9 bcn=0 [on:0 tx:0 rx:0 period:1] from screen [on:0 period:1005491996] gl rssi=-63 ag=0 ticks 0,0,35 ls-=0 [56,56,60,60,60] brc=0 lrc=0
10-06 09:55:03.811 318-419/? E/ThermalEngine: [GPU_MON] 0 percent. Current Sampling Time is 1 sec
10-06 09:55:04.550 23896-23896/? E/b: Unable to connect to the editor to retrieve text... will retry later

1 个答案:

答案 0 :(得分:0)

Ok after a lot of time, Ive got it:

I had 2 value files with the name "String", one was English and one was Hebrew, the problem was that i defined the array only in one of them, and the project couldn't reach it because in the error log showed that it couldn't find the array.

the second problem: I had a value file called "themes" and it changed all my design to an older design, after changing it in the layout it worked out.