Realm-java: RealmProxy is not generated

Created on 8 Apr 2017  Â·  6Comments  Â·  Source: realm/realm-java

Goal

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.

Code Sample

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.

Version of Realm and tooling

Realm version(s): 3.1.1

Realm sync feature enabled: no

Android Studio version: 2.3.1

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})

All 6 comments

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:

@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})

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlbertVilaCalvo picture AlbertVilaCalvo  Â·  3Comments

yuwu picture yuwu  Â·  3Comments

AAChartModel picture AAChartModel  Â·  3Comments

wezley98 picture wezley98  Â·  3Comments

cmelchior picture cmelchior  Â·  3Comments