Android 5.0.1 VerifyError? - android

I have just updated the OS on my phone to Android 5.0.1. Since this update, an app that I am working on, that is working perfectly fine on my other devices, is now throwing an error in 5.0.1 only. I have no idea what this error means, and it isn't pointing me to a suspicious line of code like it often does.
Has anyone seen this or know what it is about with the new 5.0.1?
06-23 16:52:37.840 10976-10976/rule02.touchpool E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: rule02.touchpool, PID: 10976
java.lang.VerifyError: rule02.touchpool.GameScreen
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1650)
at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2537)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2759)
at android.app.ActivityThread.access$900(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5944)
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:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

For anyone else having any issues since the Android update, I have found and resolved my issue.
The allowed maximum method size has obviously changed. Some of my methods were quite large and complex, and this new limit was obviously exceeded.
This fix was to break larger sections of code into smaller sections.
Hope this helps someone.

Related

Android Studio: Problems with WebView.onCreateInputConnection

I wrote a webview application for some Android 4.2 device with a custom inapp keyboard. In fact, the app runs without any error on devices with Android 4.2.
I know this is a very old android version, this is reason why I got now a new device with Android 7.1.2, but unfortunately, the app doesn't work on this device.
In the following code example I create an InputConnection to the WebView and assume that reference to my custom keyboard.
This is the code who turns into an error:
val ic = mWebView.onCreateInputConnection(EditorInfo())
mMyKeyboard.setInputConnection(ic)
Code of "setInputConnection" of object "MyKeyboard"
fun setInputConnection(ic: InputConnection) {
inputConnection = ic
}
error message:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.aaa.bbb, PID: 5012
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.aaa.bbb/com.example.aaa.bbb.MainActivity}: java.lang.IllegalStateException: ic must not be null
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.IllegalStateException: ic must not be null
at com.example.huf.ifsscan.MainActivity.onCreate(MainActivity.kt:59)
at android.app.Activity.performCreate(Activity.java:6723)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6123) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) 
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
Currently I have no idea why this happens.
The documentation for "onCreateInputConnection" of WebView object show it should be fine.
Android Developers | Webview
There is no different if I compile it under API 19 (Android 4.2) or API 25 (7.1).
Does anyone have any idea what the problems might be?
Thanks in advance
It seems like I found the problem.
In the app for Android 4.2 the above code of getting and assuming the inputConnection was part of the "onCreate" function. It semms like Android 7.1 works there a little bit different, after I moved the specified code part to "onPageFinished" function, it works fine.
I guess there is a reference missing in the onCreate function. But I find it odd that it worked before.

AndroidStudio doesn't run app on device [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 years ago.
I'm developing an Android application with Android Studio and since today I can no longer run the app because when Android Studio installs the apk on my device, the package installer crashes with the following message "Unfortunately, package installer has stopped". The strange thing is that when I run the application I can see for a second the main activity and its components but then everything crashes.
This is the exception:
10-15 22:16:48.185 1793-1793/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.packageinstaller, PID: 1793
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity}: java.lang.NullPointerException: Attempt to get length of null array
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5451)
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.NullPointerException: Attempt to get length of null array
at com.android.packageinstaller.permission.ui.GrantPermissionsActivity.computePermissionGrantState(GrantPermissionsActivity.java:312)
at com.android.packageinstaller.permission.ui.GrantPermissionsActivity.updateDefaultResults(GrantPermissionsActivity.java:362)
at com.android.packageinstaller.permission.ui.GrantPermissionsActivity.onCreate(GrantPermissionsActivity.java:105)
at android.app.Activity.performCreate(Activity.java:6323)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494) 
at android.app.ActivityThread.access$900(ActivityThread.java:153) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5451) 
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 very much in advance
You have an issue with "granted permissions on runtime", basically you must grant permissions to use specific functionalities.
Have a look here: https://developer.android.com/training/permis
Have a look at you manifest and check which of the "user-permissions" are required to check in runtime, if you have not user-permissions added, then now is the time https://developer.android.com/guide/topics/manifest/uses-permission-element.html.
Then use the code provided in the first link after to check runtime permissions.
Remember: ask permissions on runtime is required for Android 6.0 (API level 23) and above. On lower SDK (<=22), is enough adding the "user-permissions" into the manifest.

Android crash related to android.app.LoadedApk.makeApplication(LoadedApk.java:563)

An app gets quite a few crashes with the following stack trace
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4530)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method:0)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:940)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:735)
Caused by: java.lang.IllegalStateException:
at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:409)
at android.app.LoadedApk.makeApplication(LoadedApk.java:555)
The stack trace does not have any trace of the app's code. Considering the large user base, it is relatively rare (about 1 per 10K active devices per day). I cannot figure out any clues from the above information. Could anyone shed some light on this to help prevent this crash?
Edit (2017-06-14):
The following screenshot of Google Play Console shows that the top 6 crash clusters do not have app code in their stack traces:
java.lang.IllegalArgumentException in android.view.WindowManagerGlobal.findViewLocked
java.lang.IllegalArgumentException
in android.view.WindowManagerGlobal.findViewLocked
java.lang.IllegalArgumentException
in android.view.WindowManagerGlobal.findViewLocked
in tgkill
in tgkill
java.lang.IllegalStateException
in android.app.LoadedApk.initializeJavaContextClassLoader

Crash after isCurrentInputMethodAsSamsungKeyboard on a Samsung tablet

I'm seeing a few crashes from a Samsung Galaxy Tab S tablet. All I have is the stacktrace, which doesn't help much:
Fatal Exception: java.lang.SecurityException: get package info: Neither user 1110217 nor current process has android.permission.INTERACT_ACROSS_USERS.
at android.os.Parcel.readException(Parcel.java:1540)
at android.os.Parcel.readException(Parcel.java:1493)
at com.android.internal.view.IInputMethodManager$Stub$Proxy.isCurrentInputMethodAsSamsungKeyboard(IInputMethodManager.java:1289)
at android.view.inputmethod.InputMethodManager.isCurrentInputMethodAsSamsungKeyboard(InputMethodManager.java:2526)
at android.widget.Editor$SuggestionsPopupWindow.updateSuggestions(Editor.java:3004)
at android.widget.Editor$SuggestionsPopupWindow.show(Editor.java:2873)
at android.widget.Editor.showSuggestions(Editor.java:1995)
at android.widget.Editor$1.run(Editor.java:1830)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
It's obvious that my app doesn't care about INTERACT_ACROSS_USERS. The system ends up requesting that exception after isCurrentInputMethodAsSamsungKeyboard, which I've never seen before.
Any clues?

MonkeyTalk Causing VerifyException in Android Activity

I'm trying to integrate MonkeyTalk automation into my pre-existing Android app that is built using gradle.
I followed the steps here: Android Studio and MonkeyTalk? and got the demo app working, but when I run it in my own application I get the following crash on the second screen. Any idea why this happens?
This particular stack trace is using L preview targeting SDK 19, but I've also seen a similar (less detailed) stack trace on a Galaxy S4 with SDK 18 on it.
07-21 15:35:18.394 14642-14642/com.example.android.debug E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.android.debug, PID: 14642
java.lang.VerifyError: Rejecting class com.example.android.activity.main.MainActivity because it failed compile-time verification (declaration of 'com.example.android.activity.main.MainActivity' appears in /data/app/com.example.android.debug-1.apk)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1572)
at android.app.Instrumentation.newActivity(Instrumentation.java:1062)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.access$800(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5070)
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:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
Any idea what this means? I'm using Dagger for dependency injection, is that why it might not work?
You can try the latest version of the monkeytalk and i guess your problem will not occur again.

Categories

Resources