scala-android/sbt-android-protify

java.lang.Class cannot be cast to android.app.ContextImpl$ServiceFetcher

Closed this issue · 6 comments

Hello. I tired to start it with android:run on android-19 device and it fails at startup. If you need any more information just tell me.

D/AndroidRuntime(20654): Shutting down VM
E/AndroidRuntime(20654): FATAL EXCEPTION: main
E/AndroidRuntime(20654): Process: com.example.debug, PID: 20654
E/AndroidRuntime(20654): java.lang.RuntimeException: Unable to create application com.example.debug.DebugApplication: java.lang.ClassCastException: java.lang.Class cannot be cast to android.app.ContextImpl$ServiceFetcher
E/AndroidRuntime(20654):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4640)
E/AndroidRuntime(20654):        at android.app.ActivityThread.access$1500(ActivityThread.java:155)
E/AndroidRuntime(20654):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
E/AndroidRuntime(20654):        at android.os.Handler.dispatchMessage(Handler.java:110)
E/AndroidRuntime(20654):        at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(20654):        at android.app.ActivityThread.main(ActivityThread.java:5388)
E/AndroidRuntime(20654):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(20654):        at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(20654):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(20654):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:655)
E/AndroidRuntime(20654):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(20654): Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to android.app.ContextImpl$ServiceFetcher
E/AndroidRuntime(20654):        at android.app.ContextImpl.getSystemService(ContextImpl.java:1742)
E/AndroidRuntime(20654):        at android.content.ContextWrapper.getSystemService(ContextWrapper.java:557)
E/AndroidRuntime(20654):        at com.hanhuy.android.protify.agent.internal.ProtifyLayoutInflater.install(ProtifyLayoutInflater.java:68)
E/AndroidRuntime(20654):        at com.hanhuy.android.protify.agent.Protify.install(Protify.java:27)
E/AndroidRuntime(20654):        at com.example.debug.DebugApplication.onCreate(DebugApplication.scala:10)
E/AndroidRuntime(20654):        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime(20654):        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4637)
E/AndroidRuntime(20654):        ... 10 more
pfn commented

What version are you using? Current is 0.8

Sent from my phone
On Sep 3, 2015 9:36 AM, "Daniil Petrov" notifications@github.com wrote:

Hello. I tired to start it with android:run and it fails at startup. Run
on android-19. If you need any more information just tell me.

D/AndroidRuntime(20654): Shutting down VME/AndroidRuntime(20654): FATAL EXCEPTION: mainE/AndroidRuntime(20654): Process: com.example.debug, PID: 20654E/AndroidRuntime(20654): java.lang.RuntimeException: Unable to create application ru.kinoplan24.debug.DebugApplication: java.lang.ClassCastException: java.lang.Class cannot be cast to android.app.ContextImpl$ServiceFetcherE/AndroidRuntime(20654): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4640)E/AndroidRuntime(20654): at android.app.ActivityThread.access$1500(ActivityThread.java:155)E/AndroidRuntime(20654): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)E/AndroidRuntime(20654): at android.os.Handler.dispatchMessage(Handler.java:110)E/AndroidRuntime(20654): at android.os.Looper.loop(Looper.java:193)E/AndroidRuntime(20654): at android.app.ActivityThread.main(ActivityThread.java:5388)E/AndroidRuntime(20654): at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(20654): at java.lang.reflect.Method.invoke(Method.java:515)E/AndroidRuntime(20654): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)E/AndroidRuntime(20654): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:655)E/AndroidRuntime(20654): at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(20654): Caused by: java.lang.ClassCastException: java.lang.Class cannot be cast to android.app.ContextImpl$ServiceFetcherE/AndroidRuntime(20654): at android.app.ContextImpl.getSystemService(ContextImpl.java:1742)E/AndroidRuntime(20654): at android.content.ContextWrapper.getSystemService(ContextWrapper.java:557)E/AndroidRuntime(20654): at com.hanhuy.android.protify.agent.internal.ProtifyLayoutInflater.install(ProtifyLayoutInflater.java:68)E/AndroidRuntime(20654): at com.hanhuy.android.protify.agent.Protify.install(Protify.java:27)E/AndroidRuntime(20654): at com.example.debug.DebugApplication.onCreate(DebugApplication.scala:10)E/AndroidRuntime(20654): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)E/AndroidRuntime(20654): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4637)E/AndroidRuntime(20654): ... 10 more


Reply to this email directly or view it on GitHub
#2.

Yes, I use 0.8

pfn commented

Probably a bug I introduced when adding support for android-23. I'll fix it
next week.

Sent from my phone
On Sep 5, 2015 12:31 PM, "Daniil Petrov" notifications@github.com wrote:

Yes, I use 0.8


Reply to this email directly or view it on GitHub
#2 (comment).

pfn commented

You can back down to 0.6 for now and it should work.

I think you forgot to upload it to maven. I can't resolve dependency already about a week =)
And there is no "0.9.1" directory

pfn commented

Quite possible, I hate sonatype, will publish on Monday

Sent from my phone
On Sep 12, 2015 3:41 PM, "Daniil Petrov" notifications@github.com wrote:

I think you forgot to upload it to maven. I can't resolve dependency
already about a week =)
And there
https://repo1.maven.org/maven2/com/hanhuy/android/protify-agent/ is no
"0.9.1" directory


Reply to this email directly or view it on GitHub
#2 (comment).