title: xxx is not part of the schema for this Realm
body: <p>I am facing this problem only when I use the AIDE app on Android to code (There is no problem when I use Android Studio). After I compile and install my app, when it's launches, the MainActivity stops.</p>
  
  <blockquote>
    <p>Device name: Nexus 6P (angler).</p>
    
    <p>Android version: 6.0.1</p>
    
    <p>Realm version: 1.1.0</p>
    
    <p>AIDE version: 3.2.160525 (Latest version).</p>
  </blockquote>
  
  <p><strong>* Log:</strong></p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.twitter.i_droidi.notah/com.twitter.i_droidi.notah.MainActivity}: java.lang.IllegalArgumentException: Notes is not part of the schema for this Realm
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2452)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
  at android.app.ActivityThread.-wrap11(ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5481)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
  Caused by: java.lang.IllegalArgumentException: Notes is not part of the schema for this Realm
  at io.realm.internal.modules.CompositeMediator.getMediator(CompositeMediator.java:132)
  at io.realm.internal.modules.CompositeMediator.getTableName(CompositeMediator.java:79)
  at io.realm.RealmSchema.getSchemaForClass(RealmSchema.java:235)
  at io.realm.RealmQuery.&lt;init&gt;(RealmQuery.java:136)
  at io.realm.RealmQuery.createQuery(RealmQuery.java:85)
  at io.realm.Realm.where(Realm.java:925)
  at com.twitter.i_droidi.notah.RealmController.getNotes(RealmController.java:74)
  at com.twitter.i_droidi.notah.MainActivity.onCreate(MainActivity.java:87)
  at android.app.Activity.performCreate(Activity.java:6251)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
  ... 10 more
  </code></pre>
  
  <p><strong>* MainActivity.java:</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
  
      private Toolbar toolbar = null;
      private NavigationView navigationView = null;
      private NotesAdapter adapter;
      private Realm realm;
      private RecyclerView recyclerView;
      private RealmChangeListener realmChangeListener;
      private TextView textView1;
      private TextView textView2;
      private String version;
      private TextView versionText;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
  
          this.realm = RealmController.with(this).getRealm();
  
          toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
  
          textView1 = (TextView) findViewById(R.id.textView1);
          textView2 = (TextView) findViewById(R.id.textView2);
  
          DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.coordinatorlayout_drawerlayout_mainactivity);
          ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navi_drawer_open, R.string.navi_drawer_close);
          drawerLayout.setDrawerListener(toggle);
          toggle.syncState();
  
          try
          {
              PackageInfo packageInfo = getApplicationContext().getPackageManager().getPackageInfo(getApplicationContext().getPackageName(), PackageManager.GET_ACTIVITIES);
              version = packageInfo.versionName;
          }
          catch(PackageManager.NameNotFoundException e)
          {
              e.printStackTrace();
          }
  
          versionText = (TextView) findViewById(R.id.app_version);
          if(versionText != null)
              versionText.setText(version);
  
          navigationView = (NavigationView) findViewById(R.id.nav_view);
  
          setupRecycler();
  
          setRealmAdapter(RealmController.with(this).getNotes());
  
  ...
  </code></pre>
  
  <p><strong>* RealmController.java:</strong></p>
  
  <pre><code>public class RealmController {
  
      private static RealmController instance;
      private final Realm realm;
  
      private RealmController(Application application)
      {
          realm = Realm.getDefaultInstance();
      }
  
      private static RealmController with(Fragment fragment)
      {
          if(instance == null)
          {
              instance = new RealmController(fragment.getActivity().getApplication());
          }
  
          return instance;
      }
  
      protected static RealmController with(Activity activity)
      {
          if(instance == null)
          {
              instance = new RealmController(activity.getApplication());
          }
  
          return instance;
      }
  
      private static RealmController with(Application application)
      {
          if(instance == null)
          {
              instance = new RealmController(application);
          }
  
          return instance;
      }
  
      protected static RealmController getInstance()
      {
          return instance;
      }
  
      protected Realm getRealm()
      {
          return realm;
      }
  
      protected void refresh()
      {
          realm.waitForChange();
      }
  
      private void clearAll()
      {
          realm.beginTransaction();
          RealmResults&lt;Notes&gt; results = realm.where(Notes.class).findAll();
          results.deleteAllFromRealm();
          realm.commitTransaction();
      }
  
      protected RealmResults&lt;Notes&gt; getNotes()
      {
          return realm.where(Notes.class).findAll();
      }
  
      private Notes getNote(int id)
      {
          return realm.where(Notes.class).equalTo("id", id).findFirst();
      }
  
      protected boolean hasNotes()
      {
          return !realm.where(Notes.class).findAll().isEmpty();
      }
  }
  </code></pre>
  
  <p><strong>* Notes.java:</strong></p>
  
  <pre><code>public class Notes extends RealmObject {
  
      @PrimaryKey
      private int id;
      private String title;
      private String body;
      private String date;
  
      protected int getId() {
          return id;
      }
  
      protected void setId(int id) {
          this.id = id;
      }
  
      protected String getTitle() {
          return title;
      }
  
      protected void setTitle(String title) {
          this.title = title;
      }
  
      protected String getBody() {
          return body;
      }
  
      protected void setBody(String body) {
          this.body = body;
      }
  
      protected String getDate() {
          return date;
      }
  
      protected void setDate(String date) {
          this.date = date;
      }
  }
  </code></pre>