[Xperia Z2 Q&A, Help & Troubleshooting] bawng:
Hi!

Does anyone know how you would go about to get the CM12 dialer to work in a stock lollipop rom.

I've managed to build the dialer from source using

make Dialer

in the repo tree. This produces a Dialer.apk in out/target/product/generic/system/priv-app/Dialer and a Dialer.odex in out/target/product/generic/system/priv-app/Dialer/arm.

I've pushed these to my phone and placed them in /system/apps/cmDialer and fixed permissions to 644.

However, I get an FC as soon as I try to start the app.

It seems that the main error is

IOException: Failed to open oat file from /system/app/cmDialer/arm/Dialer.odex (error) (no dalvik_cache availible) and relocation failed.

This is however preceded by a stacktrace about ClassNotFoundException but I'm guessing the class can't be found because the .odex file can't be read for whatever reason.

Here's the full stack:

03-19 23:31:36.675: E/AndroidRuntime(11411): FATAL EXCEPTION: main
03-19 23:31:36.675: E/AndroidRuntime(11411): Process: com.android.dialer, PID: 11411
03-19 23:31:36.675: E/AndroidRuntime(11411): java.lang.RuntimeException: Unable to instantiate application com.android.dialer.DialerApplication: java.lang.ClassNotFoundException: Didn't find class "com.android.dialer.DialerApplication" on path: DexPathList[[zip file "/system/app/cmDialer/Dialer.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.LoadedApk.makeApplication(LoadedApk.java:569)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4591)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.ActivityThread.access$1500(ActivityThread.java:149)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1385)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.os.Handler.dispatchMessage(Handler.java:102)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.os.Looper.loop(Looper.java:211)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.ActivityThread.main(ActivityThread.java:5321)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.reflect.Method.invoke(Native Method)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.reflect.Method.invoke(Method.java:372)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
03-19 23:31:36.675: E/AndroidRuntime(11411): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.dialer.DialerApplication" on path: DexPathList[[zip file "/system/app/cmDialer/Dialer.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.Instrumentation.newApplication(Instrumentation.java:979)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.LoadedApk.makeApplication(LoadedApk.java:564)
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 10 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Suppressed: java.io.IOException: Zip archive '/system/app/cmDialer/Dialer.apk' doesn't contain classes.dex (error msg: Entry not found)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexFile.openDexFileNative(Native Method)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexFile.openDexFile(DexFile.java:295)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexFile.<init>(DexFile.java:80)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexFile.<init>(DexFile.java:59)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexPathList.loadDexFile(DexPathList.java:262)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexPathList.makeDexElements(DexPathList.java:231)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.DexPathList.<init>(DexPathList.java:109)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.LoadedApk.getClassLoader(LoadedApk.java:367)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at android.app.LoadedApk.makeApplication(LoadedApk.java:559)
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 10 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Caused by: java.io.IOException: Failed to open oat file from dex location '/system/app/cmDialer/Dialer.apk'
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 22 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Caused by: java.io.IOException: Failed to open oat file from /system/app/cmDialer/arm/Dialer.odex (error ) (no dalvik_cache availible) and relocation failed.
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 22 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Caused by: java.io.IOException:
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 22 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Suppressed: java.lang.ClassNotFoundException: com.android.dialer.DialerApplication
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.Class.classForName(Native Method)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-19 23:31:36.675: E/AndroidRuntime(11411):	at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-19 23:31:36.675: E/AndroidRuntime(11411):	... 13 more
03-19 23:31:36.675: E/AndroidRuntime(11411):	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Anyone got any idea of what I'm doing wrong? Am I missing some files or something?

Thanks!