在looper.java中解决nonnull和notnull符号的问题

pra*_*k r 10 android android-gradle-plugin

我正在开发一个Android应用程序请帮我解决依赖错误.

package android.os;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
Run Code Online (Sandbox Code Playgroud)

我添加了以下依赖项:

dependencies {

    compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.parse:parse-android:1.12.0'
    compile fileTree(include: '*.jar', dir: 'libs')
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:support-annotations:23.1.1'
}
Run Code Online (Sandbox Code Playgroud)

Roh*_*5k2 16

在依赖项中添加以下内容

compile 'com.android.support:support-annotations:+'
Run Code Online (Sandbox Code Playgroud)

另外,验证这一点

转到文件 - >设置 - >搜索"可空"并验证这些设置.

在此输入图像描述

在此输入图像描述


Kev*_*OUX 7

由于Google在IO17 gradle:3.0上宣布,compile配置现已弃用,应由implementation或替换api

所以更喜欢

dependencies {
    ...
    implementation 'com.android.support:support-annotations:27.1.1'
    ...
}
Run Code Online (Sandbox Code Playgroud)

或更高版本


Kan*_*mal 5

在依赖项中添加以下内容

dependencies {
    compile 'com.android.support:support-annotations:+'
}
Run Code Online (Sandbox Code Playgroud)