sockeqwe / sqlbrite-dao

DAO for SQLBrite
http://hannesdorfmann.com/android/sqlbrite-dao
Apache License 2.0
182 stars 22 forks source link

Object Mapper: Cannot find symbol class ContentValuesBuilder #40

Closed janwo closed 8 years ago

janwo commented 8 years ago

I am experiencing a problem regarding the object mapper.

I created two classes and annotated them with @ObjectMappable. I annotated all public setter-methods (fields are private) with @Column("nameOfTheSQLColumn") and added

apt 'com.hannesdorfmann.sqlbrite:object-mapper:0.6.0'
compile 'com.hannesdorfmann.sqlbrite:dao:0.6.0'
compile 'com.hannesdorfmann.sqlbrite:annotations:0.6.0'

to the dependencies of my modules gradle file. Unfortunately I get the following error: Cannot find symbol class ContentValuesBuilder. It seems like something went wrong during the generation of the ContentValuesBuilder-class. Within my build folder, I do not find any Mapper classes. I cannot figure out the problem. Do you have any idea?

sockeqwe commented 8 years ago

Are you using java or kotlin? If you are annotating a private field private int foo you have to provide a setter public void setFoo(int). Do you have such a setter? Can you provide your annotated class so that I can try to reproduce this issue?

janwo commented 8 years ago

Thank you Hannes for your quick answer. I am using Java.

The annotated class:

@ObjectMappable
public class Location {

public static final String TABLE_NAME = "locations";
public static final String COL_ID = "_id";
public static final String COL_CITY_ID = "city_id";
public static final String COL_CITY_NAME = "city_name";
public static final String COL_AUTOLOCATED = "autolocated";
public static final String COL_LAST_ONLINE_UPDATE = "last_online_update";
public static final String COL_LATITUDE = "lat";
public static final String COL_LONGITUDE = "lon";

private long id;
private long cityId;
private String cityName;
private boolean autolocated;
private long lastOnlineUpdate;
private float latitude;
private float longitude;
private List<LocationForecast> forecasts;

public long getId() {
    return id;
}

@Column( COL_ID )
public void setId( final long id ) {
    this.id = id;
}

public long getCityId() {
    return cityId;
}

@Column( COL_CITY_ID )
public void setCityId( final long cityId ) {
    this.cityId = cityId;
}

public String getCityName() {
    return cityName;
}

@Column( COL_CITY_NAME )
public void setCityName( final String cityName ) {
    this.cityName = cityName;
}

public boolean isAutolocated() {
    return autolocated;
}

@Column( COL_AUTOLOCATED )
public void setAutolocated( final boolean autolocated ) {
    this.autolocated = autolocated;
}

public float getLatitude() {
    return latitude;
}

@Column( COL_LATITUDE )
public void setLatitude( final float latitude ) {
    this.latitude = latitude;
}

public float getLongitude() {
    return longitude;
}

@Column( COL_LONGITUDE )
public void setLongitude( final float longitude ) {
    this.longitude = longitude;
}

public long getLastOnlineUpdate() {
    return lastOnlineUpdate;
}

@Column( COL_LAST_ONLINE_UPDATE )
public void setLastOnlineUpdate( long lastOnlineUpdate ) {
    this.lastOnlineUpdate = lastOnlineUpdate;
}

public List<LocationForecast> getForecasts() {
    return forecasts;
}

public void setForecasts( List<LocationForecast> forecasts ) {
    this.forecasts = forecasts;
}
  }
sockeqwe commented 8 years ago

Thanks, I can't see anything wrong. I will try to reproduce the issue tomorrow.

Thanks for reporting

nhattan123 commented 8 years ago

thank you for emailing toi.do exactly is the problem that I am suffering !! I do not know how that all devices to access the internet from my network are being redirected to another server!

nhattan123 commented 8 years ago

I'm having problems with the map! I hope github can help issues for you!

Đã gửi từ iPhone của tôi

Ngày 04-04-2016, vào lúc 19:13, Jan Wolf notifications@github.com viết:

I am experiencing a problem regarding the object mapper

I created two classes and annotated them with @ObjectMappable. I annotated all public setter-methods (fields are private) with @Column("nameOfTheSQLColumn") and added

apt 'com.hannesdorfmann.sqlbrite:object-mapper:0.6.0' compile 'com.hannesdorfmann.sqlbrite:dao:0.6.0' compile 'com.hannesdorfmann.sqlbrite:annotations:0.6.0' to the dependencies of my modules gradle file. Unfortunately I get the following error: Cannot find symbol class ContentValuesBuilder. It seems like something went wrong during the generation of the ContentValuesBuilder-class. Within my build folder, I do not find any Mapper classes. I cannot figure out the problem. Do you have any idea?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

sockeqwe commented 8 years ago

Sorry, I haven't found time yet for this issue, I will check that on Monday.

AdrianoCelentano commented 8 years ago
@ObjectMappable
public class Enterprise {

    public static final String TABLE_NAME = "enterprise";
    public static final String COL_ID = "id";
    public static final String COL_PSID = "psid";
    public static final String COL_NAME = "name";
    public static final String COL_CREATED_AT = "created_at";
    public static final String COL_MODIFIED_AT = "modified_at";
    public static final String COL_LAST_SYNCED_AT = "last_synced_at";
    public static final String COL_PHONE = "phone";
    public static final String COL_REFERRAL_TOKEN = "referral_token";

    @Column(COL_ID)
    private int id;
    @Column(COL_PSID)
    private int psid;
    @Column(COL_NAME)
    private String name;
    @Column(COL_PHONE)
    private String phone;
    @Column(COL_CREATED_AT)
    private int createdAt;
    @Column(COL_MODIFIED_AT)
    private int modifiedAt;
    @Column(COL_LAST_SYNCED_AT)
    private int lastSyncedAt;
    @Column(COL_REFERRAL_TOKEN)
    private String referral_token;

    public int getId() {
        return id;
    }

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

    public int getPsid() {
        return psid;
    }

    public void setPsid(int psid) {
        this.psid = psid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(int createdAt) {
        this.createdAt = createdAt;
    }

    public int getModifiedAt() {
        return modifiedAt;
    }

    public void setModifiedAt(int modifiedAt) {
        this.modifiedAt = modifiedAt;
    }

    public int getLastSyncedAt() {
        return lastSyncedAt;
    }

    public void setLastSyncedAt(int lastSyncedAt) {
        this.lastSyncedAt = lastSyncedAt;
    }

    public String getReferral_token() {
        return referral_token;
    }

    public void setReferral_token(String referral_token) {
        this.referral_token = referral_token;
    }
}
AdrianoCelentano commented 8 years ago
public final class EnterpriseMapper {
  public static final Func1<Cursor, Enterprise> MAPPER = new Func1<Cursor, Enterprise>() {
    @Override public Enterprise call(Cursor cursor) {
      int last_synced_atIndex = cursor.getColumnIndexOrThrow("last_synced_at");
      int phoneIndex = cursor.getColumnIndexOrThrow("phone");
      int nameIndex = cursor.getColumnIndexOrThrow("name");
      int created_atIndex = cursor.getColumnIndexOrThrow("created_at");
      int psidIndex = cursor.getColumnIndexOrThrow("psid");
      int idIndex = cursor.getColumnIndexOrThrow("id");
      int modified_atIndex = cursor.getColumnIndexOrThrow("modified_at");
      int referral_tokenIndex = cursor.getColumnIndexOrThrow("referral_token");
      Enterprise item = new Enterprise();
      if (last_synced_atIndex >= 0) {
        item.setLastSyncedAt( cursor.getInt( last_synced_atIndex ) );
      }
      if (phoneIndex >= 0) {
        item.setPhone( cursor.getString( phoneIndex ) );
      }
      if (nameIndex >= 0) {
        item.setName( cursor.getString( nameIndex ) );
      }
      if (created_atIndex >= 0) {
        item.setCreatedAt( cursor.getInt( created_atIndex ) );
      }
      if (psidIndex >= 0) {
        item.setPsid( cursor.getInt( psidIndex ) );
      }
      if (idIndex >= 0) {
        item.setId( cursor.getInt( idIndex ) );
      }
      if (modified_atIndex >= 0) {
        item.setModifiedAt( cursor.getInt( modified_atIndex ) );
      }
      if (referral_tokenIndex >= 0) {
        item.setReferral_token( cursor.getString( referral_tokenIndex ) );
      }
      return item;
    }
  };

  private EnterpriseMapper() {
  }

  /**
   * Get a typesafe ContentValues Builder 
   * @return The ContentValues Builder 
   */
  public static com.android.papershiftstempeluhr.model.ContentValuesBuilder contentValues() {
    return new com.android.papershiftstempeluhr.model.ContentValuesBuilder();
  }

  /**
   * Builder class to generate type sage {@link ContentValues } . At the end you have to call {@link #build()}
   */
  public static class ContentValuesBuilder {
    private ContentValues contentValues;

    private ContentValuesBuilder() {
      contentValues = new ContentValues();
    }

    /**
     * Creates and returnes a ContentValues from the builder
     * @return ContentValues */
    public ContentValues build() {
      return contentValues;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder lastSyncedAt(final int value) {
      contentValues.put("last_synced_at", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder lastSyncedAtAsNull() {
      contentValues.putNull( "last_synced_at" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder phone(final String value) {
      contentValues.put("phone", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder phoneAsNull() {
      contentValues.putNull( "phone" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder name(final String value) {
      contentValues.put("name", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder nameAsNull() {
      contentValues.putNull( "name" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder createdAt(final int value) {
      contentValues.put("created_at", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder createdAtAsNull() {
      contentValues.putNull( "created_at" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder psid(final int value) {
      contentValues.put("psid", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder psidAsNull() {
      contentValues.putNull( "psid" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder id(final int value) {
      contentValues.put("id", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder idAsNull() {
      contentValues.putNull( "id" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder modifiedAt(final int value) {
      contentValues.put("modified_at", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder modifiedAtAsNull() {
      contentValues.putNull( "modified_at" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder referral_token(final String value) {
      contentValues.put("referral_token", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return com.android.papershiftstempeluhr.model.ContentValuesBuilder
     */
    public com.android.papershiftstempeluhr.model.ContentValuesBuilder referral_tokenAsNull() {
      contentValues.putNull( "referral_token" );
      return this;
    }
  }
}
sockeqwe commented 8 years ago

@daffunn @AdrianoCelentano Could you please give me information about your javac version? Both models from you work fine on my machine (code generated as expected) ...

janwo commented 8 years ago

@sockeqwe Thank you for your effort. My javac version is 1.8.0_25.

AdrianoCelentano commented 8 years ago

Mine is 1.8.0_51

sockeqwe commented 8 years ago

Hm, I have tried it with 1.7.0.51 , oracle64-1.8.0.25 and 1.8.0_51 but on my machine it compiles.

Could you please clone this repo: https://github.com/sockeqwe/sqlbrite-dao-issue40

and just try if it compiles / runs without errors (do a clean before)? Uses @daffunn sample code

AdrianoCelentano commented 8 years ago

Compiled for me

janwo commented 8 years ago

Same for me. Strange.

In the other project I got the following generated file.

package de.jan_wolf.skytive.data.db.models;

import android.content.ContentValues;
import android.database.Cursor;
import java.lang.String;
import rx.functions.Func1;

/**
 * Generated class to work with Cursors and ContentValues for Location
 */
public final class LocationMapper {
  public static final Func1<Cursor, Location> MAPPER = new Func1<Cursor, Location>() {
    @Override public Location call(Cursor cursor) {
      int city_nameIndex = cursor.getColumnIndexOrThrow("city_name");
      int autolocatedIndex = cursor.getColumnIndexOrThrow("autolocated");
      int lonIndex = cursor.getColumnIndexOrThrow("lon");
      int _idIndex = cursor.getColumnIndexOrThrow("_id");
      int last_online_updateIndex = cursor.getColumnIndexOrThrow("last_online_update");
      int latIndex = cursor.getColumnIndexOrThrow("lat");
      int city_idIndex = cursor.getColumnIndexOrThrow("city_id");
      Location item = new Location();
      if (city_nameIndex >= 0) {
        item.setCityName( cursor.getString( city_nameIndex ) );
      }
      if (autolocatedIndex >= 0) {
        item.setAutolocated( cursor.getInt( autolocatedIndex ) == 1 );
      }
      if (lonIndex >= 0) {
        item.setLongitude( cursor.getFloat( lonIndex ) );
      }
      if (_idIndex >= 0) {
        item.setId( cursor.getLong( _idIndex ) );
      }
      if (last_online_updateIndex >= 0) {
        item.setLastOnlineUpdate( cursor.getLong( last_online_updateIndex ) );
      }
      if (latIndex >= 0) {
        item.setLatitude( cursor.getFloat( latIndex ) );
      }
      if (city_idIndex >= 0) {
        item.setCityId( cursor.getLong( city_idIndex ) );
      }
      return item;
    }
  };

  private LocationMapper() {
  }

  /**
   * Get a typesafe ContentValues Builder 
   * @return The ContentValues Builder 
   */
  public static de.jan_wolf.skytive.data.db.models.ContentValuesBuilder contentValues() {
    return new de.jan_wolf.skytive.data.db.models.ContentValuesBuilder();
  }

  /**
   * Builder class to generate type sage {@link ContentValues } . At the end you have to call {@link #build()}
   */
  public static class ContentValuesBuilder {
    private ContentValues contentValues;

    private ContentValuesBuilder() {
      contentValues = new ContentValues();
    }

    /**
     * Creates and returnes a ContentValues from the builder
     * @return ContentValues */
    public ContentValues build() {
      return contentValues;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder cityName(final String value) {
      contentValues.put("city_name", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder cityNameAsNull() {
      contentValues.putNull( "city_name" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder autolocated(final boolean value) {
      contentValues.put("autolocated", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder autolocatedAsNull() {
      contentValues.putNull( "autolocated" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder longitude(final float value) {
      contentValues.put("lon", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder longitudeAsNull() {
      contentValues.putNull( "lon" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder id(final long value) {
      contentValues.put("_id", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder idAsNull() {
      contentValues.putNull( "_id" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder lastOnlineUpdate(final long value) {
      contentValues.put("last_online_update", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder lastOnlineUpdateAsNull() {
      contentValues.putNull( "last_online_update" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder latitude(final float value) {
      contentValues.put("lat", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder latitudeAsNull() {
      contentValues.putNull( "lat" );
      return this;
    }

    /**
     * Adds the given value to this ContentValues
     * @param value The value
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder cityId(final long value) {
      contentValues.put("city_id", value);
      return this;
    }

    /**
     * Adds a null value to this ContentValues
     * @return de.jan_wolf.skytive.data.db.models.ContentValuesBuilder
     */
    public de.jan_wolf.skytive.data.db.models.ContentValuesBuilder cityIdAsNull() {
      contentValues.putNull( "city_id" );
      return this;
    }
  }
}

If I change de.jan_wolf.skytive.data.db.models.ContentValuesBuilder to ContentValuesBuilder it should work fine though.

sockeqwe commented 8 years ago

Ok, I guess I found the problem ... The problem seems to be that sqlbrite-dao annotation processor internally uses JavaPoet 1.3.0 to generate java code. I assume that your project is using another annotation processor that uses a later version of JavaPoet, with will cause that sqlbrite-dao annotation processor also uses the later version of JavaPoet. Unfortunately there seems to be an internal change of JavaPoet since 1.3.0 that causes this issue. So I have updated sqlbrite-dao to latest java poet version and was able to reproduce the issue you have reported. Could you verify that this is the case in your apps? Please post your dependencies graph here: ./gradlew :app:dependencies so that I can verify that this "overriding" of JavaPoet version was the cause of this issue.

I have published a snapshot version 0.6.1-SNAPSHOT to

maven {
      url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }

Please test if this SNAPSHOT solves your problem.

Thanks!

janwo commented 8 years ago

Great it compiled! Good work! Regarding the dependencies graph I always get the following error when calling ./gradlew :app:dependencies within the terminal: Project 'app' not found in root project 'skytive'.

sockeqwe commented 8 years ago

you have to replace :app with whatever your gradle module is called in your project that contains dependency to sqlbrite-dao

janwo commented 8 years ago

Oh that was embarrassing, sorry for that. The dependency graph contains com.squareup:javapoet:1.3.0 and looks like this:


apt
+--- com.bluelinelabs:logansquare-compiler:1.3.7
|    +--- org.apache.commons:commons-lang3:3.2 -> 3.4
|    +--- com.squareup:javapoet:1.2.0 -> 1.3.0
|    \--- com.bluelinelabs:logansquare:1.3.7
|         \--- com.fasterxml.jackson.core:jackson-core:2.5.1
+--- com.google.dagger:dagger-compiler:2.1
|    +--- com.google.dagger:dagger:2.1
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-producers:2.1
|    |    +--- com.google.dagger:dagger:2.1 (*)
|    |    \--- com.google.guava:guava:19.0-rc2
|    \--- com.google.guava:guava:19.0-rc2
+--- com.hannesdorfmann.sqlbrite:object-mapper:0.6.0
|    +--- com.hannesdorfmann.sqlbrite:annotations:0.6.0
|    +--- io.reactivex:rxjava:1.0.14 -> 1.1.2
|    +--- com.google.android:android:4.1.1.4
|    |    +--- commons-logging:commons-logging:1.1.1
|    |    +--- org.apache.httpcomponents:httpclient:4.0.1
|    |    |    +--- org.apache.httpcomponents:httpcore:4.0.1
|    |    |    +--- commons-logging:commons-logging:1.1.1
|    |    |    \--- commons-codec:commons-codec:1.3
|    |    +--- org.khronos:opengl-api:gl1.1-android-2.1_r1
|    |    +--- xerces:xmlParserAPIs:2.6.2
|    |    +--- xpp3:xpp3:1.1.4c
|    |    \--- org.json:json:20080701
|    +--- org.apache.commons:commons-lang3:3.4
|    +--- com.google.auto.service:auto-service:1.0-rc2
|    |    +--- com.google.auto:auto-common:0.3
|    |    |    \--- com.google.guava:guava:18.0 -> 19.0-rc2
|    |    \--- com.google.guava:guava:18.0 -> 19.0-rc2
|    \--- com.squareup:javapoet:1.3.0
+--- com.android.support:appcompat-v7:23.3.0
|    +--- com.android.support:support-vector-drawable:23.3.0
|    |    \--- com.android.support:support-v4:23.3.0
|    |         \--- com.android.support:support-annotations:23.3.0
|    +--- com.android.support:animated-vector-drawable:23.3.0
|    |    \--- com.android.support:support-vector-drawable:23.3.0 (*)
|    \--- com.android.support:support-v4:23.3.0 (*)
+--- com.android.support:design:23.3.0
|    +--- com.android.support:appcompat-v7:23.3.0 (*)
|    +--- com.android.support:support-v4:23.3.0 (*)
|    \--- com.android.support:recyclerview-v7:23.3.0
|         +--- com.android.support:support-v4:23.3.0 (*)
|         \--- com.android.support:support-annotations:23.3.0
+--- com.google.android.gms:play-services-location:8.4.0
|    +--- com.google.android.gms:play-services-base:8.4.0
|    |    \--- com.google.android.gms:play-services-basement:8.4.0
|    |         \--- com.android.support:support-v4:23.0.0 -> 23.3.0 (*)
|    \--- com.google.android.gms:play-services-maps:8.4.0
|         \--- com.google.android.gms:play-services-base:8.4.0 (*)
+--- com.squareup.retrofit2:retrofit:2.0.0
|    \--- com.squareup.okhttp3:okhttp:3.2.0
|         \--- com.squareup.okio:okio:1.6.0
+--- com.squareup.retrofit2:adapter-rxjava:2.0.0
|    +--- com.squareup.retrofit2:retrofit:2.0.0 (*)
|    \--- io.reactivex:rxjava:1.1.1 -> 1.1.2
+--- com.github.aurae.retrofit:converter-logansquare:1.2.0
+--- io.reactivex:rxjava:1.1.2
+--- io.reactivex:rxandroid:1.1.0
|    \--- io.reactivex:rxjava:1.1.0 -> 1.1.2
+--- com.jakewharton.rxbinding:rxbinding:0.4.0
|    +--- io.reactivex:rxandroid:1.1.0 (*)
|    +--- io.reactivex:rxjava:1.1.0 -> 1.1.2
|    \--- com.android.support:support-annotations:23.1.0 -> 23.3.0
+--- com.jakewharton:butterknife:7.0.1
+--- com.jakewharton.timber:timber:4.1.1
+--- com.google.dagger:dagger:2.1 (*)
+--- com.bluelinelabs:logansquare:1.3.7 (*)
+--- com.hannesdorfmann.sqlbrite:dao:0.6.0
|    \--- com.squareup.sqlbrite:sqlbrite:0.6.0
|         +--- com.android.support:support-annotations:23.0.0 -> 23.3.0
|         \--- io.reactivex:rxjava:1.1.0 -> 1.1.2
+--- com.hannesdorfmann.sqlbrite:annotations:0.6.0
\--- org.glassfish:javax.annotation:10.0-b28
sockeqwe commented 8 years ago

Sorry, I meant could you please post the dependencies tree before using 0.6.1-SNAPSHOT (with old 0.6.0)

janwo commented 8 years ago

Updated the code

sockeqwe commented 8 years ago

Hm, I was expecting to see Dagger 2.1 compiler is overriding javapoet to 1.5.1 but that gradle dependency graph doesn't say that. Nevertheless, after having looked at Dagger 2.1 dependencies I'm pretty sure that dagger overrides java poet version which has caused this issue.

So for me it is fixed. Thanks for your patience and help!

nhattan123 commented 8 years ago

who sent code of markdows issue ! i'm not happy with that's

nhattan123 commented 8 years ago

https://oss.sonatype.org/content/repositories/snapshots/archetype-catalog.xml

Đã gửi từ iPhone của tôi

Ngày 08-04-2016, vào lúc 20:17, Hannes Dorfmann notifications@github.com viết:

Ok, I guess I found the problem ... The problem seems to be that this library internally uses JavaPoet 1.3.0 to generate java code. I assume that your project is using another annotation processor that uses a later version of JavaPoet, with will cause that SqlBriteDao Annotation Processor also uses the later version of JavaPoet. Unfortunately there seems to be an internal change of JavaPoet since 1.3.0 that causes this issue. So I have updated sqlbrite-dao to latest java poet version and was able to reproduce the issue you have reported. Could you verify that this is the case in your apps? Please post your dependencies graph here: ./gradlew :app:dependencies so that I can verify that this "overriding" of JavaPoet version was the cause of this issue.

nhattan123 commented 8 years ago

https://oss.sonatype.org/content/repositories/snapshots/archetype-catalog.xml.sha1

Đã gửi từ iPhone của tôi

Ngày 08-04-2016, vào lúc 20:17, Hannes Dorfmann notifications@github.com viết:

Ok, I guess I found the problem ... The problem seems to be that this library internally uses JavaPoet 1.3.0 to generate java code. I assume that your project is using another annotation processor that uses a later version of JavaPoet, with will cause that SqlBriteDao Annotation Processor also uses the later version of JavaPoet. Unfortunately there seems to be an internal change of JavaPoet since 1.3.0 that causes this issue. So I have updated sqlbrite-dao to latest java poet version and was able to reproduce the issue you have reported. Could you verify that this is the case in your apps? Please post your dependencies graph here: ./gradlew :app:dependencies so that I can verify that this "overriding" of JavaPoet version was the cause of this issue.

I have published a snapshot version 0.6.1-SNAPSHOT to

maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } Please test if this SNAPSHOT solves your problem.

Thanks!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub