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

Support for AndroidX #148

Closed
passsy opened this Issue Jul 4, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@passsy
Member

passsy commented Jul 4, 2018

I tried to convert a project to AndroidX and failed. Most problems are caused because the TiActivity extends android.support.v7.app.AppCompatActivity and not the new androidx.appcompat.app.AppCompatActivity resulting in crashes like this:

     Caused by: java.lang.ClassCastException: androidx.appcompat.widget.ContentFrameLayout cannot be cast to android.support.v7.widget.ContentFrameLayout
        at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:486)
        at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.leicacamera.oneleicaapp.scaffold.ScaffoldActivity.onCreate(ScaffoldActivity.kt:75)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)

It could be a bug of the android.enableJetifier which is not able to convert the packages correctly.

Anyhow we should come up with a solution and think about the right time to move to AndroidX.

@passsy

This comment has been minimized.

Member

passsy commented Jul 4, 2018

The problem could also be a result of the compileOnly dependency of appcompat. We could try to use api.

@StefMa

This comment has been minimized.

Member

StefMa commented Jul 4, 2018

@passsy

This comment has been minimized.

Member

passsy commented Jul 4, 2018

I think api is correct because we are extending Fragment and Activity and therefore they are part of our public API.

But it turns out AndroidX works with ThirtyInch (except for #149) and we don't have issues due to the provided. I made a mistake when setting it up resulting in this strange crash.

@passsy

This comment has been minimized.

Member

passsy commented Aug 6, 2018

fixed in 0.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment