Używam nowego AndroidX w moim projekcie i muszę użyć Nulllable (@Nullable) w moim kodzie, ale kiedy próbuję „importować android.support.annotation.Nullable;”, to polecenie zwraca do mnie: „Nie można rozwiąż symbol 'adnotacja' ".

To jest mój build.gradle na poziomie modułu:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    // Implementação da autenticação com o servirdor firebase
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    //Implementação da parte visual do Firebase
    implementation 'com.firebaseui:firebase-ui-auth:6.1.0'
    // Implementação de imagens arrendodas
    implementation 'de.hdodenhof:circleimageview:3.0.1'
    // Autenticação geral com o servirdor do Firebase
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    // Autenticação integrada ao google play services
    implementation 'com.google.firebase:firebase-analytics:17.2.0' // Integração ao Google Análises
    implementation 'com.google.firebase:firebase-messaging:20.0.0'
    // Integração ao sistema de notifação
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    // Integração com o banco de dados
    implementation 'com.google.firebase:firebase-firestore:21.1.1'
    implementation 'com.google.firebase:firebase-storage:19.1.0'
    implementation 'androidx.multidex:multidex:2.0.0'
    // Integração ao sistema de autenticação de usuário
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.1.0'
    implementation 'androidx.navigation:navigation-ui:2.1.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.work:work-runtime:2.2.0'
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'

}
apply plugin: 'com.google.gms.google-services'
3
luke cross 2 styczeń 2020, 16:53

1 odpowiedź

Najlepsza odpowiedź

Nie mieszaj obsługi Androida i androidx .

W przypadku androidx użyj androidx.annotation.Nullable

3
Bruno 2 styczeń 2020, 13:56