Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

363
Views
Realm Android javassist.NotFoundException: io.realm.com_example_realmtest_data_SomethingRealmProxyInterface

I was completely new to realm in android, and I started from simple kotlin-project with only one entity which had only one field.

open class Something : RealmObject() {
   @PrimaryKey 
   var id: Long = 0
}

I initialized Realm in my Application class:

class RealmApp : Application() {

    override fun onCreate() {
        super.onCreate()

        Realm.init(this)
        val config = RealmConfiguration.Builder().build()
        Realm.setDefaultConfiguration(config)
    }
}

And, of course I added realm plugin:

//Project level
dependencies {
    ...
    classpath "io.realm:realm-gradle-plugin:5.9.0"
}

//Module level
apply plugin: 'realm-android'

Simple project, but every time I tried to compile it, exception appeared:

Caused by: javassist.NotFoundException: io.realm.com_example_realmtest_data_SomethingRealmProxyInterface
at javassist.ClassPool.get(ClassPool.java:452)
at io.realm.transformer.BytecodeModifier$Companion.addRealmProxyInterface(ByteCodeModifier.kt:96)
at io.realm.transformer.build.BuildTemplate.transformModelClasses(BuildTemplate.kt:109)
at io.realm.transformer.RealmTransformer.transform(RealmTransformer.kt:107)
at com.android.build.api.transform.Transform.transform(Transform.java:288)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)

I searched for whole day to solve this problem, but didn't find anything.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

So it turned out that I simply needed apply plugin: 'kotlin-kapt' in my module level build.gradle. Looks like Kotlin need that to generate these classes. I lost a lot of time because of that silly mistake, so I hope that this answer will help people that are getting similar error.

EDIT

And as musoof mentioned in the comments, order of apply plugin: 'kotlin-kapt' matters. You have to include it before apply plugin: 'realm-android'. Otherwise you will still get the same error.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!