I am new to Android Studio and I don\'t get why my toolbar isn\'t shown as described by https://developer.android.com/training/appbar/setting-up I know there are already som
https://github.com/DonaldDu/FixUnhandledEvent
android.view.View$OnUnhandledKeyEventListener is add in api28.
If runtime device below 28, can't find the class, but run without fatal error.
We can inject the class in debug mode to ignore error message.
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//inject class when api<28 && debug==true
debugImplementation 'com.github.DonaldDu:FixUnhandledEvent:1.0'
If using Android X and androidx.core:core
and/or androidx.appcompat:appcompat
, update androidx.core:core
to 1.4.0-alpha01
and/or androidx.appcompat:appcompat
to 1.3.0-alpha01
It's not an error but a warning it can be ignored by the addition of the following code in my build.gradle (app level) the file works in my case. Then sync and build the project. Hopefully, it fixes the issue.
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
}
Reference to the gist
There's problem with library ~-v7:28.0.0. There are two solutions, your can either download compile and targetSdkVersion to 27 or upgrade Android Studio to latest version (3.2.x higher).
Downgrading to sdk 27 as one of the other post suggested came with a new set of problems for me. see: Android - resource linking failed / failed linking references
Adding an entry to my build.gradle (app level) solved the issue for me.
dependencies {
...
implementation 'androidx.core:core:1.4.0-alpha01'
...
}
Here's where I got the idea to try this: https://github.com/android/sunflower/issues/295#issuecomment-649630057
Add multidex support library to your dependencies
com.android.support:multidex:1.0.3