I have tried to update Realm v1.1.0 to Realm v3.1.1 but have the next issue:
RealmProxy classes don't generate for RealmObject.
I have a simple class like this. It use Parcel, but PremiseRealmProxy not exists so project can not be compiled.
@org.parceler.Parcel(implementations = {PremiseRealmProxy.class},
value = Parcel.Serialization.FIELD,
analyze = {Premise.class})
public class Premise extends RealmObject{
....
build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath "io.realm:realm-gradle-plugin:1.1.0"
..
also the latest version of parceler
compile 'org.parceler:parceler-api:1.1.6'
apt 'org.parceler:parceler:1.1.6'
PS. I got this warning
"Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior."
Maybe this reason of error.
Realm version(s): 3.1.1
Realm sync feature enabled: no
Android Studio version: 2.3.1
What is your Gradle plugin order? apply plugin...
And also you need to show if you have anything that is apt and also annotationProcessor, you need either one or the other
Technically the simple fix is to remove apply plugin: 'android-apt' completely, and change your apts in your dependencies to annotationProcessor
Resolved for me
Was
apply plugin: 'realm-android'
apply plugin: 'com.neenbedankt.android-apt'
just changed order on
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'realm-android'
And it works. Thank you.
Yeah, the other fix is to apply android-apt before realm-android :smile:
Also note that apt is deprecated: https://bitbucket.org/hvisser/android-apt/wiki/Migration
@cmelchior @Zhuinden Thank you.
I missed info about that apt is deprecated.
Realm 5.0.0 or higer requires full name including package with _ separator
@Parcel(implementations = {com_example_test_SomeClassRealmProxy.class},
value = Parcel.Serialization.BEAN,
analyze = {SomeClass.class})
Most helpful comment
Realm 5.0.0 or higer requires full name including package with
_separator@Parcel(implementations = {com_example_test_SomeClassRealmProxy.class}, value = Parcel.Serialization.BEAN, analyze = {SomeClass.class})