Android мобильная навигация - класс действий NavController не создан - PullRequest
0 голосов
/ 06 февраля 2020

Я использую NavController в мобильном приложении, где у меня есть фрагмент с двумя вариантами навигации для другого фрагмента. Я создал оба действия в mobile_navigation. xml, но я могу получить сгенерированный класс Action.

Надеюсь, вы понимаете.

Это мой экран, я хочу go для тот же фрагмент при нажатии на кнопку или карту. enter image description here

Ответы [ 2 ]

0 голосов
/ 07 февраля 2020

Вот мой файл Gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.go.accesoapp"
        minSdkVersion 18
        vectorDrawables.useSupportLibrary = true
        targetSdkVersion 29
        versionCode 1
        versionName "1.1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation "androidx.cardview:cardview:1.0.0"
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'me.ydcool.lib:qrmodule:latest.integration'
    implementation 'com.squareup.picasso:picasso:2.71828'
    apply plugin: "androidx.navigation.safeargs"
    implementation 'androidx.navigation:navigation-fragment:2.0.0'
    implementation 'androidx.navigation:navigation-ui:2.0.0'
}
0 голосов
/ 06 февраля 2020

Есть ли у вас ниже зависимости в вашем файле build.gradle? Это может привести к тому, что эти классы не будут генерироваться.

 implementation "androidx.navigation:navigation-fragment:2.2.0"
 implementation "androidx.navigation:navigation-ui:2.2.0"
...