Objectbox-java: androidx support

Created on 20 Nov 2018  路  4Comments  路  Source: objectbox/objectbox-java

any prevision for migration to androidx support library? following the docs https://docs.objectbox.io/livedata-arch.-comp. the observe method from LiveData is highlighted red by the ide (not found). opening the ObjectBoxLiveData class the LiveData class is missing _android.arch.lifecycle.LiveData_.

//observe not found
model.getNoteLiveData(notesBox).observe(this, new Observer<List<Note>>() {
    @Override
    public void onChanged(@Nullable List<Note>; notes) {
        notesAdapter.setNotes(notes);
    }
});
feature

Most helpful comment

I also ran into this problem.

I solved it with

  1. Delete gradle cache ( https://www.airaghi.net/en/2016/09/21/how-to-delete-gradle-cache-files/ )
  2. Restart Android Studio with "File" -> "Invalidate Caches / Restart".
  3. Indexing seems stuck, "Invalidate Caches / Restart" again.

I'm not sure this is best, but worked for me. I hope this helps.

All 4 comments

Do you have your project set up correctly for AndroidX? Check if your gradle.properties file contains:

android.useAndroidX=true
android.enableJetifier=true

Check the migration guide to continue using libraries that do not yet use the new imports.

Anyhow, leaving this open to track changing our dependencies/imports to AndroidX.
-ut

I also ran into this problem.

I solved it with

  1. Delete gradle cache ( https://www.airaghi.net/en/2016/09/21/how-to-delete-gradle-cache-files/ )
  2. Restart Android Studio with "File" -> "Invalidate Caches / Restart".
  3. Indexing seems stuck, "Invalidate Caches / Restart" again.

I'm not sure this is best, but worked for me. I hope this helps.

I also ran into this problem.

I solved it with

  1. Delete gradle cache ( https://www.airaghi.net/en/2016/09/21/how-to-delete-gradle-cache-files/ )
  2. Restart Android Studio with "File" -> "Invalidate Caches / Restart".
  3. Indexing seems stuck, "Invalidate Caches / Restart" again.

I'm not sure this is best, but worked for me. I hope this helps.

It's works!!! Thanks you friend

This is also part of the just released version '2.4.0-RC' - would be great if you could give it a try and report back. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thanhhai08sk picture thanhhai08sk  路  3Comments

ScottPierce picture ScottPierce  路  3Comments

rafakob picture rafakob  路  4Comments

rishabharora3 picture rishabharora3  路  5Comments

Mister-Seven picture Mister-Seven  路  3Comments