Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migration script fails with IllegalStateException due to SHADOW_TABLE_NAME_SUFFIXES

I've updated the Room version from 2.4.3 to 2.5.0-alpha03 and after the last migration, the JSON generated will once in a while fail with

Caused by: java.lang.IllegalStateException: Cannot parse existing schema file: C:\mypath\com.example.MyDatabase\74.json. If you've modified the file, you might've broken the JSON format, try deleting the file and re-running the compiler. 
If you've not modified the file, please file a bug at 
https://issuetracker.google.com/issues/new?component=413107&template=1096568 
with a sample app to reproduce the issue.   
    at androidx.room.vo.Database.exportSchema(Database.kt:111)  
    at androidx.room.DatabaseProcessingStep.process(DatabaseProcessingStep.kt:123)  
    at androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:123)     
    at androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor.process(JavacBasicAnnotationProcessor.kt:71)   
    at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)    
    at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:197)    
    at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:985)    ... 44 more

After checking out the differences between the last schema file 73.json and the new one, 74.json, apart from the changes I've wanted to make, there's this block:

    "SHADOW_TABLE_NAME_SUFFIXES": [
      "_content",
      "_segdir",
      "_segments",
      "_stat",
      "_docsize"
    ],
    "shadowTableNames$delegate": {
      "initializer": {},
      "_value": {}
    },

inside the only ftsVersion block I have. Whatever I write in the migration script doesn't matter, I always get the same issue. What I've found is that SHADOW_TABLE_NAME_SUFFIXES is a static variable from androidx.room.migration.bundle.FtsEntityBundle & if I delete this block from 74.json, I don't get the issue anymore.

Can anyone help me with more info on this and why it could pop up in the schema file?

like image 711
Monica Ivan Avatar asked Oct 16 '25 13:10

Monica Ivan


1 Answers

I've posted a bug report as per the stack trace's advice and it seems to be an issue from Room 2.5.0-alpha02 and 2.5.0-alpha03, which they will fix https://issuetracker.google.com/issues/246751839

like image 96
Monica Ivan Avatar answered Oct 18 '25 06:10

Monica Ivan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!