3
respostas

Erro de tipos incompativeis

Olá, baixei o projeto base e, ao executar, aparece o seguinte erro:

C:\Users\mfc20\TechNoticias\app\build\tmp\kapt3\stubs\debug\br\com\alura\technews\database\dao\NoticiaDAO.java:13: error: incompatible types: <null> cannot be converted to int
    @androidx.room.Insert(onConflict = null)
                                       ^C:\Users\mfc20\TechNoticias\app\build\tmp\kapt3\stubs\debug\br\com\alura\technews\database\dao\NoticiaDAO.java:25: error: incompatible types: <null> cannot be converted to int
    @androidx.room.Insert(onConflict = null)
3 respostas
package br.com.alura.technews.database.dao;

import java.lang.System;

@androidx.room.Dao()
@kotlin.Metadata(mv = {1, 4, 2}, bv = {1, 0, 3}, k = 1, d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010 \n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\bg\u0018\u00002\u00020\u0001J\u0012\u0010\u0002\u001a\u0004\u0018\u00010\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\'J\u000e\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00030\u0007H\'J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u0003H\'J\u0010\u0010\u000b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u0003H\'J\u0016\u0010\u000b\u001a\u00020\t2\f\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00030\u0007H\'\u00a8\u0006\r"}, d2 = {"Lbr/com/alura/technews/database/dao/NoticiaDAO;", "", "buscaPorId", "Lbr/com/alura/technews/model/Noticia;", "id", "", "buscaTodos", "", "remove", "", "noticia", "salva", "noticias", "app_debug"})
public abstract interface NoticiaDAO {

    @org.jetbrains.annotations.NotNull()
    @androidx.room.Query(value = "SELECT * FROM Noticia ORDER BY id DESC")
    public abstract java.util.List<br.com.alura.technews.model.Noticia> buscaTodos();

    @androidx.room.Insert(onConflict = null)
    public abstract void salva(@org.jetbrains.annotations.NotNull()
    br.com.alura.technews.model.Noticia noticia);

    @androidx.room.Delete()
    public abstract void remove(@org.jetbrains.annotations.NotNull()
    br.com.alura.technews.model.Noticia noticia);

    @org.jetbrains.annotations.Nullable()
    @androidx.room.Query(value = "SELECT * FROM Noticia WHERE id = :id")
    public abstract br.com.alura.technews.model.Noticia buscaPorId(long id);

    @androidx.room.Insert(onConflict = null)
    public abstract void salva(@org.jetbrains.annotations.NotNull()
    java.util.List<br.com.alura.technews.model.Noticia> noticias);
}

Fala Matheus.

Acho que deve ter rolado algo errado aí. Tu pode remover por hora a estratégia de conflito

Ok, removi e o erro sumiu, obrigado!