无法解析 Android Studio 中的符号“注释"? [英] Cannot resolve symbol 'annotation' in Android Studio?

查看:45
本文介绍了无法解析 Android Studio 中的符号“注释"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用新的 AndroidX,我需要在我的代码中使用 Nullable (@Nullable),但是,当我尝试import android.support.annotation.Nullable;"时,这个命令返回给我:无法解析符号'注释'".

i'm using the new AndroidX in my project, and i need to use Nulllable (@Nullable) in my code, but, when i try "import android.support.annotation.Nullable;", this command return to me: "Cannot resolve symbol 'annotation' ".

这是我在模块级别的 build.gradle:

This i my build.gradle in module level:

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'

推荐答案

不要混用 android 支持androidx.

对于 androidx,使用 androidx.annotation.Nullable

For androidx, use androidx.annotation.Nullable

这篇关于无法解析 Android Studio 中的符号“注释"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆