{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/1209","labels_url":"https://api.github.com/repos/realm/realm-java/issues/1209/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/1209/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/1209/events","html_url":"https://github.com/realm/realm-java/issues/1209","id":87606446,"number":1209,"title":"java.lang.ClassNotFoundException: Didn't find class \"io.realm.DefaultRealmModule\"","user":{"login":"cchcc","id":7663950,"avatar_url":"https://avatars.githubusercontent.com/u/7663950?v=3","gravatar_id":"","url":"https://api.github.com/users/cchcc","html_url":"https://github.com/cchcc","followers_url":"https://api.github.com/users/cchcc/followers","following_url":"https://api.github.com/users/cchcc/following{/other_user}","gists_url":"https://api.github.com/users/cchcc/gists{/gist_id}","starred_url":"https://api.github.com/users/cchcc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchcc/subscriptions","organizations_url":"https://api.github.com/users/cchcc/orgs","repos_url":"https://api.github.com/users/cchcc/repos","events_url":"https://api.github.com/users/cchcc/events{/privacy}","received_events_url":"https://api.github.com/users/cchcc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-java/labels/Pending","name":"Pending","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-java/labels/support","name":"support","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-12T04:54:37Z","updated_at":"2015-06-12T08:11:40Z","closed_at":"2015-06-12T08:11:40Z","body":"I wanted to make simple pre-built realm data file to external path.\r\nbut exception occured on runtime.\r\n```\r\njava.lang.ClassNotFoundException: Didn't find class \"io.realm.DefaultRealmModule\" on path: DexPathList[[zip file \"/data/app/com.all4land.osmm_pre_model_tool-2/base.apk\"],nativeLibraryDirectories=[/data/app/com.all4land.osmm_pre_model_tool-2/lib/arm, /vendor/lib, /system/lib]]\r\n```\r\nlogcat :\r\n```\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): FATAL EXCEPTION: main\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): Process: com.all4land.osmm_pre_model_tool, PID: 10645\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.all4land.osmm_pre_model_tool/com.all4land.osmm_pre_model_tool.MainActivity}: java.lang.IllegalArgumentException: Book is not part of the schema for this Realm\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2366)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread.access$800(ActivityThread.java:149)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.os.Looper.loop(Looper.java:135)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread.main(ActivityThread.java:5290)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat java.lang.reflect.Method.invoke(Native Method)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): Caused by: java.lang.IllegalArgumentException: Book is not part of the schema for this Realm\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:118)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat io.realm.internal.modules.CompositeMediator.getTableName(CompositeMediator.java:71)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat io.realm.Realm.getTable(Realm.java:311)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat io.realm.Realm.createObject(Realm.java:1069)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat com.all4land.osmm_pre_model_tool.MainActivity.onCreate(MainActivity.java:32)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.Activity.performCreate(Activity.java:5977)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259)\r\n06-12 13:24:55.555: E/AndroidRuntime(10645): \t... 10 more\r\n```\r\n\r\nmodel :\r\n```java\r\npackage com.all4land.osmm.model.pre;\r\n\r\nimport io.realm.RealmObject;\r\n\r\npublic class Book extends RealmObject\r\n{\r\n\tprivate String name;\r\n\t\r\n\tpublic String getName() {return name;}\r\n\tpublic void setName(String name) { this.name=name; }\r\n}\r\n```\r\nusing:\r\n```java\r\npackage com.all4land.osmm_pre_model_tool;\r\n\r\nimport io.realm.Realm;\r\nimport java.io.File;\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\nimport android.os.Environment;\r\nimport com.all4land.osmm.model.pre.Book;\r\n\r\npublic class MainActivity extends Activity\r\n{\r\n       @Override\r\n\tprotected void onCreate(Bundle savedInstanceState)\r\n\t{\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_main);\r\n\t\t\r\n\t\tFile folder = new File(Environment.getExternalStorageDirectory()\r\n\t\t\t\t+ \"/download\");\r\n\r\n\t\tRealm rlm = Realm.getInstance(folder, \"pre.realm\");\t// exception here\r\n\t\t\r\n\t\trlm.beginTransaction();\r\n\t\tBook b = rlm.createObject(Book.class);\r\n\t\tb.setName(\"a\");\r\n\t\trlm.commitTransaction();\r\n\t\t\r\n\t\trlm.close();\r\n\t}\r\n}\r\n```\r\nworked on\r\nEclipse Luna 4.4.2,\r\nrealm library built myself from downloaded source yesterday.\r\n\r\nI tested using precompiled v0.80.3, same result."},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/111404807","html_url":"https://github.com/realm/realm-java/issues/1209#issuecomment-111404807","issue_url":"https://api.github.com/repos/realm/realm-java/issues/1209","id":111404807,"user":{"login":"cmelchior","id":406066,"avatar_url":"https://avatars.githubusercontent.com/u/406066?v=3","gravatar_id":"","url":"https://api.github.com/users/cmelchior","html_url":"https://github.com/cmelchior","followers_url":"https://api.github.com/users/cmelchior/followers","following_url":"https://api.github.com/users/cmelchior/following{/other_user}","gists_url":"https://api.github.com/users/cmelchior/gists{/gist_id}","starred_url":"https://api.github.com/users/cmelchior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmelchior/subscriptions","organizations_url":"https://api.github.com/users/cmelchior/orgs","repos_url":"https://api.github.com/users/cmelchior/repos","events_url":"https://api.github.com/users/cmelchior/events{/privacy}","received_events_url":"https://api.github.com/users/cmelchior/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T08:11:40Z","updated_at":"2015-06-12T08:11:40Z","body":"Great you got it working. Good luck with the project :)"}}