error: package com.android.annotations does not exist

后端 未结 13 2303
南旧
南旧 2020-12-13 11:55

I have the following class

import com.android.annotations.NonNullByDefault;

@NonNullByDefault
public final class Log {
    ...
}

and here

13条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 12:37

    Open gradle.properties and use following code:

    android.useAndroidX=false
    android.enableJetifier=false
    
    

    or U can use these dependencies too:

    implementation 'androidx.appcompat:appcompat:1.0.2'
     implementation 'androidx.annotation:annotation:1.0.2'
    

提交回复
热议问题