Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I try to use it but give me java.lang.RuntimeException: An asset for requested database doesn't exist #4

Closed
droidahmed opened this issue Aug 18, 2016 · 1 comment

Comments

@droidahmed
Copy link

droidahmed commented Aug 18, 2016

I put my test.realm in assets folder /data/test.realm

     RealmAssetHelper.getInstance(this).loadDatabaseToStorage("data", "test.realm", new   
      IRealmAssetHelperStorageListener() {
         @Override
         public void onLoadedToStorage(String realmDbName, RealmAssetHelperStatus status) {
              RealmConfiguration  realmConfiguration = new RealmConfiguration.Builder(MainActivity.this)
                      .name(realmDbName)
                      .build();
              realm = Realm.getInstance(realmConfiguration);
           }

      });
@mikemee
Copy link
Collaborator

mikemee commented Aug 18, 2016

Try using test instead of test.realm - i.e. the file extension is not required and is assumed to be .realm.

If that still doesn't work, please re-open. Thanks!

@mikemee mikemee closed this as completed Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants