[Sprint LG Optimus G] AdhvanIt:
Debugging your port

Debugging:

Legend:

"E/" - Error
"E/dalvikvm"- Crucial system error
"No such file or directory" - Should be self-eplanatory.
"fail"/"failed" - Crucial error
"W/"/"warning" - Self explanatory.
"exception"(especially NullPointerException) - Points to something that was done incorrectly during the port.

Common error types:

Couldn't find native method:

method static synthetic access$100(Landroid/hardware/Camera;)
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/hardware/Camera;.Camera$PictureCallback;
E/JNIHelp ( 100): RegisterNatives failed for 'Landroid/hardware/Camera', aborting

This will help us figure out where the issue is:

E/JNIHelp ( 100): RegisterNatives failed for 'Landroid/hardware/Camera'

>>

android/hardware/Camera

The smali we're looking for is Camera.smali. Finding the path does require a little knowledge of source code structure. But in this case, we can assume that any path starting with "android" points to framework.jar

You'll want to take the single missing method from base smali and put it in the corresponding port smali. In this case, .Camera$PictureCallback. In some cases, you can get away with using entire smali files (or smali trees consisting of all smali files starting with the same name) from your base ROM in your port. Though this can cause issues if you get carried away.

Fatal signal 11:

F/libc ( 2698): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I/DEBUG ( 130): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 130): Build fingerprint: 'google/occam/mako:4.2.2/JDQ39/573038:user/release-keys'
I/DEBUG ( 130): pid: 2698, tid: 2698 >>> zygote <<<
I/DEBUG ( 130): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG ( 130): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
I/DEBUG ( 130): r4 00000000 r5 00000027 r6 4086fbfd r7 00000036
I/DEBUG ( 130): r8 40253f04 r9 40233a7e 10 0000904c fp 00009062
I/DEBUG ( 130): ip 4028b240 sp befcfa60 lr 401043c1 pc 40100adc cpsr 600
00030
I/DEBUG ( 130): d0 2f64696f72646e61 d1 2f746e65746e6f63
I/DEBUG ( 130): d2 657373412f736572 d3 726567616e614d74
I/DEBUG ( 130): d4 0000d4cc0000d4b1 d5 0000d4e80000d4cd

When you see a code block like the start of that one, look just above it. You'll find the error that caused it up a few lines.

Unable to extract+optimize DEX from '/system/framework/framework.jar' and other errors:

D/dalvikvm( 103): DexOpt: --- BEGIN 'framework.jar' (bootstrap=1) ---
E/dalvikvm( 172): Duplicate class definition: 'Landroid/media/MediaRecorder;'
E/dalvikvm( 172): Trouble with item 2900 @ offset 0x17a86c
E/dalvikvm( 172): Cross-item verify of section type 0006 failed
E/dalvikvm( 172): ERROR: Byte swap + verify failed
E/dalvikvm( 172): Optimization failed
W/dalvikvm( 103): DexOpt: --- END 'framework.jar' --- status=0xff00, process failed
E/dalvikvm( 103): Unable to extract+optimize DEX from '/system/framework/framework.jar'
D/dalvikvm( 103): Unable to process classpath element '/system/framework/framework.jar'
E/JNIHelp ( 103): Native registration unable to find class 'android/debug/JNITest', aborting

E/NetworkLocationRealOs(2304): no android ID; can't access encrypted cache
E/NetworkLocationRealOs(2304): java.io.IOException: no android ID; can't access encrypted cache

E/System(1538): java.lang.NullPointerException
E/System(1538): at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
E/System(1538): at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
E/System(1538): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
E/System(1538): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
E/System(1538): at com.android.server.ServerThread.run(SystemServer.java:167)
I/SystemServer(1538): Input Method Service
W/SystemServer(1538): ***********************************************
A/SystemServer(1538): BOOT FAILURE starting Input Manager Service
A/SystemServer(1538): java.lang.NullPointerException
A/SystemServer(1538): at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
A/SystemServer(1538): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
at com.android.server.ServerThread.run(SystemServer.java:271)
Error reporting WTF
E/AndroidRuntime(1538): java.lang.NullPointerException
E/AndroidRuntime(1538): at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(1538): at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(1538): at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(1538): at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime(1538): at com.android.server.ServerThread.run(SystemServer.java:274)

The errors above are typically tied to issues with your build. Either framework that's been decompiled/compiled improperly, or the classes that you've diffed.

---------- Post added at 02:13 PM ---------- Previous post was at 01:34 PM ----------

@BMP7777,

You should PM a mod and request this be stickied. Excellent work on the first page, and thanks to everyone that's contributed. :)