I am learning Android Studio from a book called "Learn Android Studio: Build Android Apps Quickly and Effectively" By: Clifton Craig; Adam Gerber. I am following a tutorial on how to build a Reminders app and can't get the app to load. In the tutorial, I have been instructed to alter the onCreate() method with what is provided in the book, making sure to import what they provided.
The altered code is provided here.
The logcat is provided below:
01-18 06:04:55.460 2212-2212/com.apress.gerber.reminders I/art: Not late-enabling -Xcheck:jni (already on)
01-18 06:04:55.800 2212-2212/com.apress.gerber.reminders W/System: ClassLoader referenced unknown path: /data/app/com.apress.gerber.reminders-2/lib/x86_64
01-18 06:04:55.960 2212-2212/com.apress.gerber.reminders D/AndroidRuntime: Shutting down VM
01-18 06:04:55.960 2212-2212/com.apress.gerber.reminders E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.apress.gerber.reminders, PID: 2212
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apress.gerber.reminders/com.apress.gerber.reminders.RemindersActivity}: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ListView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ListView
at com.apress.gerber.reminders.RemindersActivity.onCreate(RemindersActivity.java:22)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
01-18 06:05:00.980 2212-2212/com.apress.gerber.reminders I/Process: Sending signal. PID: 2212 SIG: 9
The app will not load. The emulator gives an error. Any feedback on this would be greatly appreciated.
Related
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gtech.edcdemo, PID: 7655
java.lang.UnsatisfiedLinkError: dalvik.system.DexClassLoader[DexPathList[[dex file "/data/user/0/com.gtech.edcdemo/files/nepcore.dex"],nativeLibraryDirectories=[/data/app/com.gtech.edcdemo-2/lib/arm, /data/resource/lib, /vendor/lib, /system/lib]]] couldn't find "libDeviceConfig.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.pax.dal.impl.utils.DeviceConfig.<clinit>(SourceFile:22)
at com.pax.dal.impl.utils.ServiceUtils.getDeviceEnable(SourceFile:89)
at com.pax.dal.impl.utils.ServiceUtils.isModuleEnable(SourceFile:101)
at com.pax.dal.impl.E.u(SourceFile:82)
at com.pax.dal.impl.E.open(SourceFile:89)
at com.gtech.edcdemo.MainActivity.onCreate(MainActivity.kt:20)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5468)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675)
I/Process: Sending signal. PID: 7655 SIG: 9
Using JniLibs in order to add NativeLib in Android studio while
My analytics are reporting the following error:
java.lang.RuntimeException Msg: (Unable to resume activity
{com.NSouth.myapp/com.NSouth.myapp.Activity_Main}:
java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=211, result=0, data=null} to activity
211 is a request code I use for an in-app purchase. Since my code is not referenced in the stacktrace, is there anything I can do about this?
Full stacktrace:
java.lang.RuntimeException
android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5422)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
android.app.ActivityThread.performResumeActivity(ActivityThread.java:3089)
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
android.app.ActivityThread.-wrap11(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5422)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
When I run the app the application crash.
I'm using the new android plugin 2.1.0
Failed to create directory /data/data/ric.es.pruebavideo/files/instant-run/dex
05-05
Couldn't create dex code folder
05-05 22:13:05.024 28257-28257/ric.es.pruebavideo D/AndroidRuntime: Shutting down VM
05-05 22:13:05.026 28257-28257/ric.es.pruebavideo E/AndroidRuntime: FATAL EXCEPTION: main
Process: ric.es.pruebavideo, PID: 28257
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ric.es.pruebavideo/ric.es.pruebavideo.VideoRActivity}: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Suppressed: java.lang.ClassNotFoundException: ric.es.pruebavideo.VideoRActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
05-05 22:18:21.137 29791-29791/ric.es.pruebavideo D/Mobility: Selected camera resolution: 1280 x 720
05-05 22:18:21.210 29791-29791/ric.es.pruebavideo I/Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread.
Downgrading grudle to 2.0.0 worked for me
I don't know where this error comes from. It appears when I start the app and crashes!
Error message and stack trace:
09-16 17:57:32.022 2441-2441/com.example.tobias.uebung1 E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.tobias.uebung1, PID: 2441
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tobias.uebung1/com.example.tobias.uebung1.main}: android.content.res.Resources$NotFoundException: String resource ID #0xfffffffd
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0xfffffffd
at android.content.res.Resources.getText(Resources.java:312)
at android.widget.TextView.setText(TextView.java:4417)
at com.example.tobias.uebung1.main.Main(main.java:483)
at com.example.tobias.uebung1.main.onCreate(main.java:100)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Thank you for your help!
Read A third Line
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tobias.uebung1/com.example.tobias.uebung1.main}: android.content.res.Resources$NotFoundException: String resource ID #0xfffffffd
android.content.res.Resources$NotFoundException : Means You add Your Activity In AndroidManifest.xml File..
Or check Java File Or XML File name...
As you can tell I am a newbie to Android :) and struggling with retrieving contacts list. I did add android.permission.READ_CONTACTS in AndroidManifest.xml but still it is not working. I am running it on Windows 10, in case if that makes any difference. Thanks in advance.
09-07 17:27:15.819 5272-5272/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
09-07 17:27:15.819 5272-5272/? I/art﹕ Late-enabling JIT
09-07 17:27:15.821 5272-5272/? I/art﹕ JIT created with code_cache_capacity=2MB compile_threshold=1000
09-07 17:27:15.871 5272-5272/com.sr.phonecontactslist W/System﹕ ClassLoader referenced unknown path: /data/app/com.sr.phonecontactslist-1/lib/x86
09-07 17:27:15.879 5272-5272/com.sr.phonecontactslist D/AndroidRuntime﹕ Shutting down VM
09-07 17:27:15.879 5272-5272/com.sr.phonecontactslist E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.sr.phonecontactslist, PID: 5272
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sr.phonecontactslist/com.sr.phonecontactslist.MainActivity}: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{15540fd 5272:com.sr.phonecontactslist/u0a59} (pid=5272, uid=10059) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{15540fd 5272:com.sr.phonecontactslist/u0a59} (pid=5272, uid=10059) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
at android.content.ContentResolver.query(ContentResolver.java:475)
at android.content.ContentResolver.query(ContentResolver.java:434)
at com.sr.phonecontactslist.MainActivity.onCreate(MainActivity.java:20)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)