Issue in resolving nonnull and notnull symbol in looper.java

后端 未结 5 2027

I\'m developing an android app please help me to solve dependency error.

package android.os;
import android.support.annotation.NonNull;
import android.suppor         


        
相关标签:
5条回答
  • 2021-01-17 13:47

    Since Google announced at IO17 gradle:3.0, the compile configuration is now deprecated and should be replaced by implementation or api

    So prefer

    dependencies {
        ...
        implementation 'com.android.support:support-annotations:27.1.1'
        ...
    }
    

    or greater version

    0 讨论(0)
  • 2021-01-17 13:52

    As of android api 29 ('targetSdkVersion' 29) com.android.support has been moved to 'androidx' library. In your Build.gradle file(app level), dependencies block use...

    dependencies{ ...

    implementation 'androidx.annotation:annotation:1.1.0' }

    And in your .java files use import as follows: import androidx.annotation.NonNull; ...

    Again build your project!

    0 讨论(0)
  • 2021-01-17 13:53

    Try:

    import android.support.annotation.NonNull;
    

    Also add gradle build as other guys already mentioned:

    dependencies {
        compile 'com.android.support:support-annotations:+'
    }
    
    0 讨论(0)
  • 2021-01-17 13:57

    Add following in your dependencies

    compile 'com.android.support:support-annotations:+'
    

    Also, verify this

    Go to File -> Setting -> search for "nullable" and verify these settings.

    0 讨论(0)
  • 2021-01-17 14:06

    Add following in your dependencies

    dependencies {
        compile 'com.android.support:support-annotations:+'
    }
    
    0 讨论(0)
提交回复
热议问题