agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.88k stars 599 forks source link

Error when i try to use DBFlow, created in the last round will not be subject to annotation processing. #1103

Closed pishguy closed 7 years ago

pishguy commented 7 years ago

define database:

@Database(name = AppDatabase.NAME, version = AppDatabase.VERSION)
public class AppDatabase {

    public static final String NAME = "Appdb";
    public static final int VERSION = 1;
}

My model:

@Table(database = AppDatabase.class)
public class UserInformation extends BaseModel {
    @PrimaryKey(autoincrement = true)
    private int id;

    @Column
    private String userId;

    @Column
    private int result;

    @Column
    private Info info;

    public UserInformation() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public Info getInfo() {
        return info;
    }

    public void setInfo(Info Info) {
        this.info = Info;
    }
}

Error:

Warning:File for type 'com.raizlabs.android.dbflow.config.AppDatabaseAppdb_Database' created in the last round will not be subject to annotation processing. Warning:File for type 'com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.

Application class:

FlowManager.init(new FlowConfig.Builder(this).build());

Manifest:

<application
        android:name=".myApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

Repositories:

def dbflow_version = "4.0.0-beta3"

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:cardview-v7:+'
    compile 'com.jakewharton:butterknife:8.2.1'
    apt 'com.jakewharton:butterknife-compiler:8.2.1'
    compile 'com.google.code.gson:gson:2.6.2'

    ...

    apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
    compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
    compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
}

UserInformation_Table error:

if (index_info != -1 && !cursor.isNull(index_info)) {
      model.setInfo(cursor.????????????????????(index_info));
    } else {
      model.setInfo(null);
    }
trevjonez commented 7 years ago
Warning:File for type 'com.raizlabs.android.dbflow.config.AppDatabaseAppdb_Database' created in the last round will not be subject to annotation processing.
Warning:File for type 'com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.

These are just warnings produced by the compiler and should be ignored. The code within AppDatabaseAppdb does not need to be processed by any other APT tools.

A handful of classes generated by DBFlow are pushed to the last round of processing thus allowing other APT tools to generate dbflow table classes without being left out of the other config classes.

agrosner commented 7 years ago

this is a warning to be ignored. Its pushed off to last round of processing so we collect everything that gets generated.

pishguy commented 7 years ago

@trevjonez whats your meas about: does not need to be processed by any other APT tools. ? i dont have any other APT tools,

@agrosner i'm using android studio and when i try to compile i get this error and it cause of broken compile process. how can i ignore that?

pishguy commented 7 years ago

@agrosner @trevjonez BTW did you try to read my full post??? my mean is my bottom of post

DBFlow create corrupted _Table

UserInformation_Table error:

if (index_info != -1 && !cursor.isNull(index_info)) {
      model.setInfo(cursor.????????????????????(index_info));
    } else {
      model.setInfo(null);
    }

error is between cursor. and (index_info));

trevjonez commented 7 years ago

@tux-world it would appear that you need to provide a type converter for the Info type. Can you provide the source for the info class?

AyoPrez commented 7 years ago

Could this warning cause problem with dagger2?

trevjonez commented 7 years ago

No. These classes do not have any annotations on them that requires dagger2 to process them.

On Dec 22, 2016 2:00 AM, "Ayo" notifications@github.com wrote:

Could this warning cause problem with dagger2?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Raizlabs/DBFlow/issues/1103#issuecomment-268751457, or mute the thread https://github.com/notifications/unsubscribe-auth/AFIxB8ojQG5P7XMea_0ub7hsssLdByNoks5rKjwXgaJpZM4LKkhZ .