Mike Axle
Mike Axle

Reputation: 1097

gradle stuck at :app:mergeDebugResources after opening realm file using realm browser

My app comes with a pre-populated realm file which is stored in res/raw directory. Gradle was working just fine until i decided to open the realm file using realm browser. Now gradle gets stuck at :app:mergeDebugResources.

Usually I would edit the realm file from another directory outside the project directory and copy it over to res/raw directory when I'm done. But this time I opened the realm file stored in the res/raw directory in the project directory.

This is the second time this has happened to me. The first time I had to completely restart the project from scratch and copy code over. Downloading an older commit from GitHub didn't work either.

Has anyone else experienced this? Any fixes?

Upvotes: 4

Views: 958

Answers (1)

Mike Axle
Mike Axle

Reputation: 1097

Github saved the day. I completely deleted the local project folder and cloned my last commit from GitHub. Gradle re-built everything properly after that.

I had to make sure those temporary files created when you open a realm file with realm browser(database_name.realm.lock and database_name.realm.management/) were deleted from the res/raw directory before opening the project in android studio.

It seems the temporary files cause this problem. To anybody not using versioning, please do. its a life saver

Upvotes: 9

Related Questions