I made an app using a NavigationView and used to be able to modify the drawer menu after catching a selection in onNavigationItemSelected. The app was compiled with Android Studio version 4.1.2 and runs fine up to Android 11. Now a tablet with Android 14 came up and the installation was denied because of security requirements. So I tried to mofify the code and recompiled it, now with Android Studio version 2023(Giraffe). There were a couple of changes necessary in the Gradlebuild(app), but finally I managed to recompile, but now I cannot modify the drawer menu (clear, add new items etc.) anymore when going over the onNavigationItemSelectHandler as before.
I am quite unsure about the dependencies in the build app module and other things and would be happy if anybody could explain the fault.
Searched the web for hours and tried almost everything without success.
This is my build.gradle(app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 34
defaultConfig {
applicationId "com.examples.dbrezepte5"
minSdkVersion 30
targetSdkVersion 31
versionCode 814
versionName "Rezepte5"
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
namespace 'com.examples.dbrezepte5'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.11.0'
implementation "androidx.drawerlayout:drawerlayout:1.2.0"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}