[G2 and Desire Z Q&A, Help & Troubleshooting] utx:
Hiw to add Sense framework to any ROM

I am trying to add Sense support (and applications) to Mimicry (CM Andromadus based), but I am failing.

What I did:

- took a random HTC ICS ROM (me took Cool-ICS-v9-EvoC)

- copied (com.htc.*.jar, HTC*.jar) missing jar files to /system/framework

- hot rebooted

I expected, that Android will find added libraries and use them. But it does not. It only runs optimization of these classes to Dalvik cache.

I even tried to implant Lcom/htc/* methods to framework.jar (baksmali, copy files, smali, zip)

But the error is still the same (see below).

What i am doing bad? com.htc.app.HtcProgressDialog seems to be implemented in HTCExtension.jar. Is there any way to transfer HTC Sense support to any ROM? (My most wanted application is Locations, because I purchased lifetime navigation.)

I/ActivityManager(20156): Start proc com.htc.fm for activity com.htc.fm/.FMRadio: pid=22153 uid=10143 gids={3003, 1015}
I/dalvikvm(22134): Total arena pages for JIT: 11
I/dalvikvm(22134): Total arena pages for JIT: 12
I/dalvikvm(22134): Total arena pages for JIT: 13
I/dalvikvm(22134): Total arena pages for JIT: 14
I/dalvikvm(22134): Total arena pages for JIT: 15
I/dalvikvm(22134): Total arena pages for JIT: 16
I/dalvikvm(22134): Total arena pages for JIT: 17
D/dalvikvm(20156): GC_EXPLICIT freed 207K, 33% free 8013K/11911K, paused 3ms+5ms
D/OpenGLRenderer(20628): Flushing caches (mode 1)
D/OpenGLRenderer(20628): Flushing caches (mode 0)
W/dalvikvm(22153): VFY: unable to find class referenced in signature (Lcom/htc/app/HtcProgressDialog;)
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.dismiss, referenced from method com.htc.fm.FMRadio.dismissTurnOffDialog
W/dalvikvm(22153): VFY: unable to resolve virtual method 337: Lcom/htc/app/HtcProgressDialog;.dismiss ()V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x000e
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.hide, referenced from method com.htc.fm.FMRadio.dismissTurnOffDialog
W/dalvikvm(22153): VFY: unable to resolve virtual method 339: Lcom/htc/app/HtcProgressDialog;.hide ()V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x0013
W/dalvikvm(22153): VFY: unable to find class referenced in signature (Lcom/htc/widget/HeaderBarImage;)
E/dalvikvm(22153): Could not find class 'com.htc.widget.HeaderBarMiddle', referenced from method com.htc.fm.FMRadio.initUi
W/dalvikvm(22153): VFY: unable to resolve check-cast 291 (Lcom/htc/widget/HeaderBarMiddle;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x1f at 0x0020
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.setProgress, referenced from method com.htc.fm.FMRadio.onSeekComplete
W/dalvikvm(22153): VFY: unable to resolve virtual method 347: Lcom/htc/app/HtcProgressDialog;.setProgress (I)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x0060
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.isShowing, referenced from method com.htc.fm.FMRadio.onSeekComplete
W/dalvikvm(22153): VFY: unable to resolve virtual method 340: Lcom/htc/app/HtcProgressDialog;.isShowing ()Z
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x006f
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.findViewById, referenced from method com.htc.fm.FMRadio.resetScanProgressDialog
W/dalvikvm(22153): VFY: unable to resolve virtual method 338: Lcom/htc/app/HtcProgressDialog;.findViewById (I)Landroid/view/View;
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x0009
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.findViewById, referenced from method com.htc.fm.FMRadio.resetTurnOnProgress
W/dalvikvm(22153): VFY: unable to resolve virtual method 338: Lcom/htc/app/HtcProgressDialog;.findViewById (I)Landroid/view/View;
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x000f
I/dalvikvm(22153): Could not find method com.htc.widget.HeaderBarImage.setFocusable, referenced from method com.htc.fm.FMRadio.setUIDisable
W/dalvikvm(22153): VFY: unable to resolve virtual method 2333: Lcom/htc/widget/HeaderBarImage;.setFocusable (Z)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x0014
E/dalvikvm(22153): Could not find class 'com.htc.widget.HeaderBarImage', referenced from method com.htc.fm.FMRadio.setUIDisable
W/dalvikvm(22153): VFY: unable to resolve check-cast 290 (Lcom/htc/widget/HeaderBarImage;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x1f at 0x0047
E/dalvikvm(22153): Could not find class 'com.htc.widget.HeaderBarImage', referenced from method com.htc.fm.FMRadio.setUIDisable
W/dalvikvm(22153): VFY: unable to resolve check-cast 290 (Lcom/htc/widget/HeaderBarImage;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x1f at 0x007b
I/dalvikvm(22153): Could not find method com.htc.widget.HeaderBarImage.setFocusable, referenced from method com.htc.fm.FMRadio.setUIEnable
W/dalvikvm(22153): VFY: unable to resolve virtual method 2333: Lcom/htc/widget/HeaderBarImage;.setFocusable (Z)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x001f
E/dalvikvm(22153): Could not find class 'com.htc.widget.HeaderBarImage', referenced from method com.htc.fm.FMRadio.setUIEnable
W/dalvikvm(22153): VFY: unable to resolve check-cast 290 (Lcom/htc/widget/HeaderBarImage;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x1f at 0x0057
E/dalvikvm(22153): Could not find class 'com.htc.widget.HeaderBarImage', referenced from method com.htc.fm.FMRadio.setUIEnable
W/dalvikvm(22153): VFY: unable to resolve check-cast 290 (Lcom/htc/widget/HeaderBarImage;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x1f at 0x008b
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.isShowing, referenced from method com.htc.fm.FMRadio.setUIEnable
W/dalvikvm(22153): VFY: unable to resolve virtual method 340: Lcom/htc/app/HtcProgressDialog;.isShowing ()Z
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x010a
E/dalvikvm(22153): Could not find class 'com.htc.app.HtcProgressDialog', referenced from method com.htc.fm.FMRadio.showTurnOffDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 127 (Lcom/htc/app/HtcProgressDialog;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x0014
E/dalvikvm(22153): Could not find class 'com.htc.widget.HtcAlertDialog$Builder', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 299 (Lcom/htc/widget/HtcAlertDialog$Builder;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x0011
E/dalvikvm(22153): Could not find class 'com.htc.widget.HtcAlertDialog$Builder', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 299 (Lcom/htc/widget/HtcAlertDialog$Builder;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x002f
E/dalvikvm(22153): Could not find class 'com.htc.widget.HtcAlertDialog$Builder', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 299 (Lcom/htc/widget/HtcAlertDialog$Builder;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x0051
E/dalvikvm(22153): Could not find class 'com.htc.app.HtcProgressDialog', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 127 (Lcom/htc/app/HtcProgressDialog;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x0078
E/dalvikvm(22153): Could not find class 'com.htc.app.HtcProgressDialog', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 127 (Lcom/htc/app/HtcProgressDialog;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x00a3
E/dalvikvm(22153): Could not find class 'com.htc.app.HtcProgressDialog', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 127 (Lcom/htc/app/HtcProgressDialog;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x00b6
E/dalvikvm(22153): Could not find class 'com.htc.widget.HtcAlertDialog$Builder', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 299 (Lcom/htc/widget/HtcAlertDialog$Builder;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x00fe
E/dalvikvm(22153): Could not find class 'com.htc.widget.HtcAlertDialog$Builder', referenced from method com.htc.fm.FMRadio.onCreateDialog
W/dalvikvm(22153): VFY: unable to resolve new-instance 299 (Lcom/htc/widget/HtcAlertDialog$Builder;) in Lcom/htc/fm/FMRadio;
D/dalvikvm(22153): VFY: replacing opcode 0x22 at 0x011d
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.setProgress, referenced from method com.htc.fm.FMRadio.onScanComplete
W/dalvikvm(22153): VFY: unable to resolve virtual method 347: Lcom/htc/app/HtcProgressDialog;.setProgress (I)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x000b
I/dalvikvm(22153): Could not find method com.htc.util.skin.HtcSkinUtil.getDrawableResIdentifier, referenced from method com.htc.fm.FMRadio.onTurnOff
W/dalvikvm(22153): VFY: unable to resolve static method 2332: Lcom/htc/util/skin/HtcSkinUtil;.getDrawableResIdentifier (Landroid/content/Context;Ljava/lang/String;I)I
D/dalvikvm(22153): VFY: replacing opcode 0x71 at 0x0019
I/dalvikvm(22153): Could not find method com.htc.util.skin.HtcSkinUtil.getDrawableResIdentifier, referenced from method com.htc.fm.FMRadio.onTurnOn
W/dalvikvm(22153): VFY: unable to resolve static method 2332: Lcom/htc/util/skin/HtcSkinUtil;.getDrawableResIdentifier (Landroid/content/Context;Ljava/lang/String;I)I
D/dalvikvm(22153): VFY: replacing opcode 0x71 at 0x0055
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0150 at 0x16 in Lcom/htc/fm/FMRadio;.showTurnOffDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0927 at 0x13 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0927 at 0x31 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0927 at 0x53 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0150 at 0x7a in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0150 at 0xa5 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0150 at 0xb8 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0927 at 0x100 in Lcom/htc/fm/FMRadio;.onCreateDialog
D/dalvikvm(22153): DexOpt: unable to opt direct call 0x0927 at 0x11f in Lcom/htc/fm/FMRadio;.onCreateDialog
W/dalvikvm(22153): VFY: unable to find class referenced in signature (Lcom/htc/app/HtcProgressDialog;)
W/dalvikvm(22153): VFY: unable to find class referenced in signature (Lcom/htc/app/HtcProgressDialog;)
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.setProgress, referenced from method com.htc.fm.FMRadio$14.handleMessage
W/dalvikvm(22153): VFY: unable to resolve virtual method 347: Lcom/htc/app/HtcProgressDialog;.setProgress (I)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x00e6
W/dalvikvm(22153): VFY: unable to find class referenced in signature (Lcom/htc/app/HtcProgressDialog;)
I/dalvikvm(22153): Could not find method com.htc.app.HtcProgressDialog.setProgress, referenced from method com.htc.fm.FMRadio$14.handleMessage
W/dalvikvm(22153): VFY: unable to resolve virtual method 347: Lcom/htc/app/HtcProgressDialog;.setProgress (I)V
D/dalvikvm(22153): VFY: replacing opcode 0x6e at 0x010d
I/dalvikvm(22153): Failed resolving Lcom/htc/fm/MusicListActivity; interface 293 'Lcom/htc/widget/HtcAbsListView$OnScrollListener;'
W/dalvikvm(22153): Link of class 'Lcom/htc/fm/MusicListActivity;' failed
W/dalvikvm(22153): Unable to resolve superclass of Lcom/htc/fm/HTCListActivity; (256)
W/dalvikvm(22153): Link of class 'Lcom/htc/fm/HTCListActivity;' failed
W/dalvikvm(22153): Unable to resolve superclass of Lcom/htc/fm/FMPresetBrowserActivity; (231)
W/dalvikvm(22153): Link of class 'Lcom/htc/fm/FMPresetBrowserActivity;' failed
E/dalvikvm(22153): Could not find class 'com.htc.fm.FMPresetBrowserActivity', referenced from method com.htc.fm.FMRadio$21.onClick
W/dalvikvm(22153): VFY: unable to resolve const-class 152 (Lcom/htc/fm/FMPresetBrowserActivity;) in Lcom/htc/fm/FMRadio$21;
D/dalvikvm(22153): VFY: replacing opcode 0x1c at 0x0041
D/FMRadio (22153): [FMRadio][Activity] onCreate()
I/ActivityManager(20156): Start proc com.android.settings for broadcast com.android.settings/.cmstats.ReportingServiceManager: pid=22168 uid=1000 gids={1015, 3002, 3001, 3003, 3007}
E/ActivityThread(22153): Failed to inflate
E/ActivityThread(22153): android.view.InflateException: Binary XML file line #11: Error inflating class com.htc.widget.HeaderBarMiddle
E/ActivityThread(22153):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
E/ActivityThread(22153):	at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
E/ActivityThread(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/ActivityThread(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/ActivityThread(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/ActivityThread(22153):	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
E/ActivityThread(22153):	at android.app.Activity.setContentView(Activity.java:1835)
E/ActivityThread(22153):	at com.htc.fm.FMRadio.switchContentView(FMRadio.java:404)
E/ActivityThread(22153):	at com.htc.fm.FMRadio.onCreate(FMRadio.java:359)
E/ActivityThread(22153):	at android.app.Activity.performCreate(Activity.java:4465)
E/ActivityThread(22153):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/ActivityThread(22153):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
E/ActivityThread(22153):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
E/ActivityThread(22153):	at android.app.ActivityThread.access$600(ActivityThread.java:132)
E/ActivityThread(22153):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
E/ActivityThread(22153):	at android.os.Handler.dispatchMessage(Handler.java:99)
E/ActivityThread(22153):	at android.os.Looper.loop(Looper.java:137)
E/ActivityThread(22153):	at android.app.ActivityThread.main(ActivityThread.java:4575)
E/ActivityThread(22153):	at java.lang.reflect.Method.invokeNative(Native Method)
E/ActivityThread(22153):	at java.lang.reflect.Method.invoke(Method.java:511)
E/ActivityThread(22153):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
E/ActivityThread(22153):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
E/ActivityThread(22153):	at dalvik.system.NativeStart.main(Native Method)
E/ActivityThread(22153): Caused by: java.lang.ClassNotFoundException: com.htc.widget.HeaderBarMiddle
E/ActivityThread(22153):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/ActivityThread(22153):	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/ActivityThread(22153):	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/ActivityThread(22153):	at android.view.LayoutInflater.createView(LayoutInflater.java:552)
E/ActivityThread(22153):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
E/ActivityThread(22153):	... 22 more
D/AndroidRuntime(22153): Shutting down VM
W/dalvikvm(22153): threadid=1: thread exiting with uncaught exception (group=0x40a5d1f8)
E/AndroidRuntime(22153): FATAL EXCEPTION: main
E/AndroidRuntime(22153): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.htc.fm/com.htc.fm.FMRadio}: android.view.InflateException: Binary XML file line #11: Error inflating class com.htc.widget.HeaderBarMiddle
E/AndroidRuntime(22153):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2079)
E/AndroidRuntime(22153):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
E/AndroidRuntime(22153):	at android.app.ActivityThread.access$600(ActivityThread.java:132)
E/AndroidRuntime(22153):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
E/AndroidRuntime(22153):	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22153):	at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(22153):	at android.app.ActivityThread.main(ActivityThread.java:4575)
E/AndroidRuntime(22153):	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(22153):	at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(22153):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
E/AndroidRuntime(22153):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
E/AndroidRuntime(22153):	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(22153): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.htc.widget.HeaderBarMiddle
E/AndroidRuntime(22153):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/AndroidRuntime(22153):	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
E/AndroidRuntime(22153):	at android.app.Activity.setContentView(Activity.java:1835)
E/AndroidRuntime(22153):	at com.htc.fm.FMRadio.switchContentView(FMRadio.java:404)
E/AndroidRuntime(22153):	at com.htc.fm.FMRadio.onCreate(FMRadio.java:359)
E/AndroidRuntime(22153):	at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(22153):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(22153):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
E/AndroidRuntime(22153):	... 11 more
E/AndroidRuntime(22153): Caused by: java.lang.ClassNotFoundException: com.htc.widget.HeaderBarMiddle
E/AndroidRuntime(22153):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
E/AndroidRuntime(22153):	at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime(22153):	at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.createView(LayoutInflater.java:552)
E/AndroidRuntime(22153):	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
E/AndroidRuntime(22153):	... 22 more
W/ActivityManager(20156): Force finishing activity com.htc.fm/.FMRadio