Problem in resolving non-zero and non-zero character in looper.java

I am developing an Android application. Help me solve the dependency error.

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

I add the following dependencies:

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'
}
+10
source share
6 answers

Add the following to your dependencies

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

Also check this out.

Go to File → Settings → find the value “nullable” and check these parameters.

enter image description here

enter image description here

+16
source

Since Google was announced in IO17 gradle: 3.0, the configuration is compilenow deprecated and needs to be replaced implementationorapi

Therefore prefer

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

or higher version

+7
source

dependencies {
    compile 'com.android.support:support-annotations:+'
}
+5

:

import android.support.annotation.NonNull;

Gradle, :

dependencies {
    compile 'com.android.support:support-annotations:+'
}
+1

Android 29 ('targetSdkVersion' 29) com.android.support 'androidx'. Build.gradle ( ) ...

{...

'androidx.annotation: annotation: 1.1.0'}

.java : import androidx.annotation.NonNull;...

!

+1

-, , ? Google Sceneform, № 6 - 8. https://codelabs.developers.google.com/codelabs/sceneform-intro/index.html?index=.. % 2F..io2018 # 11

import android.support.annotation.Nullable; . 'com.android.support:support-annotations:28.0.0' {} Nullable/Notnull. , Nullable , Nullable. .

:

package com.example.macbook.ar2;

import android.annotation.SuppressLint;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

public class PointerDrawable extends Drawable {

private final Paint paint = new Paint();
private boolean enabled;
public boolean isEnabled() {
    return enabled;
}

@Override
public void draw(@NonNull Canvas canvas) {
    float cx = canvas.getWidth()/2;
    float cy = canvas.getHeight()/2;
    if (enabled) {
        paint.setColor(Color.GREEN);
        canvas.drawCircle(cx, cy, 10, paint);
    } else {
        paint.setColor(Color.GRAY);
        canvas.drawText("X", cx, cy, paint);
    }
}



public void setEnabled(boolean enabled) {
    this.enabled = enabled;
}


@Override
public void setAlpha(int alpha) {

}

@Override
public void setColorFilter(@androidx.annotation.Nullable ColorFilter colorFilter) {

}

@SuppressLint("WrongConstant")
@Override
public int getOpacity() {
    return 0;
}

}

0

Source: https://habr.com/ru/post/1627289/


All Articles