Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Crash on Android #425

Open
ghost opened this issue Sep 14, 2017 · 1 comment
Open

Crash on Android #425

ghost opened this issue Sep 14, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 14, 2017

Using:

  • X-Code 8.3.x
  • Android Studio 2.3.3 on macOS, with SDK 25 installed
  • Realm Server on Virtualbox hosted VM with Ubuntu 16.04, latest as of 2017-09-13
  • RealmTasks latest commit as of 2017-09-13

To reproduce:

  • Start X-Code 8 and install/run app, pointing to local dev Realm Server
  • Create account, which creates a realm on the dev Realm Server
  • Start Android Studio, invoke Nexus 6 API 25 emulator
  • Uninstall any previous version of realm-tasks, if applicable, to be sure
  • Modify app/build.gradle to point to IP address of Realm Server (on local subnet, confirmed working with iOS version of RealmTasks)
  • git clone https://github.com/realm-demos/realm-tasks/issues/new
  • cd realm-tasks
  • ./gradlew installDebug
  • Open emulator and start RealmTasks
  • Try to log in with the same account that you created on iOS
  • Crash:
09-13 13:51:05.520 5625-5625/io.realm.realmtasks E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: io.realm.realmtasks, PID: 5625
                                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{io.realm.realmtasks/io.realm.realmtasks.TaskActivity}: java.lang.IllegalArgumentException: The schema was changed but the schema version was not updated. The configured schema version (0) must be higher than the one in the Realm file (0) in order to update the schema.
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                                       at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                    Caused by: java.lang.IllegalArgumentException: The schema was changed but the schema version was not updated. The configured schema version (0) must be higher than the one in the Realm file (0) in order to update the schema.
                                                                       at io.realm.Realm.initializeSyncedRealm(Realm.java:396)
                                                                       at io.realm.Realm.createAndValidate(Realm.java:315)
                                                                       at io.realm.Realm.createInstance(Realm.java:264)
                                                                       at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:143)
                                                                       at io.realm.Realm.getDefaultInstance(Realm.java:209)
                                                                       at io.realm.realmtasks.TaskActivity.onStart(TaskActivity.java:71)
                                                                       at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1237)
                                                                       at android.app.Activity.performStart(Activity.java:6253)
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                                       at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                       at android.os.Looper.loop(Looper.java:148) 
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Sorry if this is simply a newbie issue that has an easy solution. Maybe setting the server IP in app/build.gradle for the Realm Server is not sufficient? Is there something that needs to be done to coordinate schema versions between the already-created realm on the Realm Server and the new Android install? Just playing around to try out the tech for our startup.

Please LMK if more info is needed.

@Zhuinden
Copy link

I think using a newer version of Realm would fix that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant