MrLoick / droidpersistence

Automatically exported from code.google.com/p/droidpersistence
0 stars 0 forks source link

Erro com Classe Application #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

04-19 14:37:32.386: E/AndroidRuntime(3655): FATAL EXCEPTION: main
04-19 14:37:32.386: E/AndroidRuntime(3655): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.crud.view/com.crud.view.NewClasse}: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread.access$600(ActivityThread.java:123)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.os.Looper.loop(Looper.java:137)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread.main(ActivityThread.java:4424)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
java.lang.reflect.Method.invokeNative(Native Method)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
java.lang.reflect.Method.invoke(Method.java:511)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
dalvik.system.NativeStart.main(Native Method)
04-19 14:37:32.386: E/AndroidRuntime(3655): Caused by: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
com.crud.view.NewClasse.onCreate(NewClasse.java:41)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.Activity.performCreate(Activity.java:4465)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-19 14:37:32.386: E/AndroidRuntime(3655):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-19 14:37:32.386: E/AndroidRuntime(3655):     ... 11 more
04-19 14:40:40.935: D/gralloc_goldfish(5193): Emulator without GPU emulation 
detected.
04-19 14:40:45.046: D/AndroidRuntime(5193): Shutting down VM
04-19 14:40:45.056: W/dalvikvm(5193): threadid=1: thread exiting with uncaught 
exception (group=0x409c01f8)
04-19 14:40:45.125: E/AndroidRuntime(5193): FATAL EXCEPTION: main
04-19 14:40:45.125: E/AndroidRuntime(5193): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.crud.view/com.crud.view.NewClasse}: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread.access$600(ActivityThread.java:123)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.os.Looper.loop(Looper.java:137)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread.main(ActivityThread.java:4424)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
java.lang.reflect.Method.invokeNative(Native Method)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
java.lang.reflect.Method.invoke(Method.java:511)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
dalvik.system.NativeStart.main(Native Method)
04-19 14:40:45.125: E/AndroidRuntime(5193): Caused by: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
com.crud.view.NewClasse.onCreate(NewClasse.java:41)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.Activity.performCreate(Activity.java:4465)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-19 14:40:45.125: E/AndroidRuntime(5193):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-19 14:40:45.125: E/AndroidRuntime(5193):     ... 11 more
04-19 14:43:03.495: I/Process(5193): Sending signal. PID: 5193 SIG: 9
04-19 14:44:51.175: D/AndroidRuntime(6561): Shutting down VM
04-19 14:44:51.175: W/dalvikvm(6561): threadid=1: thread exiting with uncaught 
exception (group=0x409c01f8)
04-19 14:44:51.225: E/AndroidRuntime(6561): FATAL EXCEPTION: main
04-19 14:44:51.225: E/AndroidRuntime(6561): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.crud.view/com.crud.view.CrudActivity}: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudActivityApp
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread.access$600(ActivityThread.java:123)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.os.Looper.loop(Looper.java:137)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread.main(ActivityThread.java:4424)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
java.lang.reflect.Method.invokeNative(Native Method)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
java.lang.reflect.Method.invoke(Method.java:511)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
dalvik.system.NativeStart.main(Native Method)
04-19 14:44:51.225: E/AndroidRuntime(6561): Caused by: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudActivityApp
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
com.crud.view.CrudActivity.onCreate(CrudActivity.java:22)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.Activity.performCreate(Activity.java:4465)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-19 14:44:51.225: E/AndroidRuntime(6561):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-19 14:44:51.225: E/AndroidRuntime(6561):     ... 11 more
04-19 14:50:12.305: D/AndroidRuntime(8391): Shutting down VM
04-19 14:50:12.305: W/dalvikvm(8391): threadid=1: thread exiting with uncaught 
exception (group=0x409c01f8)
04-19 14:50:12.555: E/AndroidRuntime(8391): FATAL EXCEPTION: main
04-19 14:50:12.555: E/AndroidRuntime(8391): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.crud.view/com.crud.view.CrudActivity}: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread.access$600(ActivityThread.java:123)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.os.Looper.loop(Looper.java:137)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread.main(ActivityThread.java:4424)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
java.lang.reflect.Method.invokeNative(Native Method)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
java.lang.reflect.Method.invoke(Method.java:511)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
dalvik.system.NativeStart.main(Native Method)
04-19 14:50:12.555: E/AndroidRuntime(8391): Caused by: 
java.lang.ClassCastException: android.app.Application cannot be cast to 
com.crud.view.CrudApp
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
com.crud.view.CrudActivity.onCreate(CrudActivity.java:22)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.Activity.performCreate(Activity.java:4465)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-19 14:50:12.555: E/AndroidRuntime(8391):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-19 14:50:12.555: E/AndroidRuntime(8391):     ... 11 more

Original issue reported on code.google.com by WillianR...@gmail.com on 19 Apr 2012 at 2:54

GoogleCodeExporter commented 8 years ago
Serrá necessário adicionar o atributo "android:name" na tag "appplication" no 
manifest com o nome da classe que estende a classe Application.
Ex:  
<application android:icon="@drawable/icon" android:label="@string/app_name" 
android:name="com.jns.minhaplicacaolibrary.MinhaAplicacaoLibraryApp">

Original comment by julionevess on 10 Jun 2012 at 8:22

GoogleCodeExporter commented 8 years ago
Obrigado erá isso mesmo
valeu pela ajuda....

Original comment by WillianR...@gmail.com on 11 Jun 2012 at 2:20