Reputation: 1355
I've been learning android development for a few months and this is the first that I've encountered during updates. I had a project that was working fine in android studio 3.6 and I thought it would be safe to update to 4.0 since I didn't have previous troubles. However, there are all sort of error firing up the logcat. I can't get my head around all the problems.
Please tell me a few things:
Is it good/safe to update android studio in between projects?
Isn't android studio just an IDE? Shouldn't library and dependencies all be the same as it is mentioned in the gradle files? So, why is this problem appearing?
E/dalvikvm: Could not find class 'androidx.core.view.ViewCompat$2',
referenced from method
androidx.core.view.ViewCompat.addOnUnhandledKeyEventListener
06-12 13:10:29.734 6847-6847/com.huggy.activity_mediaaction E/dalvikvm:
Could not find class 'android.view.WindowInsets', referenced from method
androidx.core.view.
ViewCompat.dispatchApplyWindowInsets
06-12 13:10:29.754 6847-6847/com.huggy.activity_mediaaction E/dalvikvm:
Could not find class 'android.view.WindowInsets', referenced from method
androidx.core.view.ViewCompat.onApplyWindowInsets
06-12 13:10:29.754 6847-6847/com.huggy.activity_mediaaction E/dalvikvm:
Could not find class 'android.view.View$OnUnhandledKeyEventListener',
referenced from method
androidx.core.view.ViewCompat.removeOnUnhandledKeyEventListener
06-12 13:10:29.814 6847-6847/com.huggy.activity_mediaaction E/dalvikvm: Could
not find class
'androidx.core.view.ViewCompat$1', referenced from method
androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener
06-12 13:10:29.884 6847-6847/com.huggy.activity_mediaaction E/dalvikvm: Could
not
find class 'android.graphics.drawable.RippleDrawable', referenced from method
androidx.appcompat.widget.AppCompatImageHelper.hasOverlappingRendering
06-12 13:10:29.934 6847-6847/com.huggy.activity_mediaaction E/dalvikvm: Could
not find class
'android.view.textclassifier.TextClassificationManager', referenced from method androidx.appcompat.widget.AppCompatTextClassifierHelper.
getTextClassifier
06-12 13:10:30.024 6847-6847/com.huggy.activity_mediaaction E/dalvikvm:
Could not find class 'androidx.core.app.ActivityCompat$SharedElementCallback21Impl',
referenced from method androidx.core.app.ActivityCompat.setEnterSharedElementCallback
06-12 13:10:30.024 6847-6847/com.huggy.activity_mediaaction E/dalvikvm:
Could not find class 'androidx.core.app.ActivityCompat$SharedElementCallback21Impl',
referenced from method androidx.core.app.ActivityCompat.setExitSharedElementCallback
06-12 13:10:30.034 6847-6847/com.huggy.activity_mediaaction E/mhuggyDBHelper: Database OnCreate launched
06-12 13:10:30.054 6847-6847/com.huggy.activity_mediaaction E/CursorWindow:
Failed to read row 0, column 2 from a CursorWindow which has 5 rows, 2 columns.
06-12 13:10:30.054 6847-6847/com.huggy.activity_mediaaction E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.huggy.activity_mediaaction, PID: 6847
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.huggy.activity_mediaaction/ com.huggy.activity_mediaaction.MainActivity}:
java.lang.IllegalStateException:
Couldn't read row 0, col 2 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Couldn't read row 0, col 2 from CursorWindow.
Make sure the Cursor is initialized correctly before accessing data from it.
at android.database.CursorWindow.nativeGetString(Native Method)
at android.database.CursorWindow.getString(CursorWindow.java:434)
at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:51)
at com.huggy.activity_mediaaction.huggyDBHelper.linkAllAudioDB(huggyDBHelper.java:340)
at com.huggy.activity_mediaaction.huggyDBHelper.onCreate(huggyDBHelper.java:229)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
at android.database.sqlite.SQLiteOpenHelper.getWDB(SQLiteOpenHelper.java:164)
at com.huggy.activity_mediaaction.huggyDBHelper.<init>(huggyDBHelper.java:86)
at com.huggy.activity_mediaaction.MainActivity.onCreate(MainActivity.java:72)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Upvotes: 0
Views: 412
Reputation: 1355
what worked for me was to change the line that said:
classpath "com.android.tools.build:gradle:4.0.0"
back to:
classpath 'com.android.tools.build:gradle:3.6.3'
anyone recommend/advise something about updating the gradle build tool in the midst of a project?
Upvotes: 0
Reputation: 52
You also need to get updated with Gradle Plug-in.
See this link for better clarification for your Problem
https://developer.android.com/studio/known-issues
Upvotes: 1