sceneform-android-sdk icon indicating copy to clipboard operation
sceneform-android-sdk copied to clipboard

AndroidX support

Open dementia2029 opened this issue 5 years ago • 10 comments

After converting the project to AndroidX, i can not cast fragment to ArFragment any more like this: fragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.sceneform_fragment);

If i cast like this: fragment = (ArFragment) ((Object)getSupportFragmentManager().findFragmentById(R.id.sceneform_fragment)); I get error error: package android.support.annotation does not exist

dementia2029 avatar Aug 30 '18 12:08 dementia2029

ThanX for letting us know. We'll look into it.

abramyan avatar Sep 01 '18 00:09 abramyan

This should be taken care of by the jetifier tool (see https://proandroiddev.com/jetpack-series-1-androidx-a-headache-for-a-better-package-structure-62c3608596fd for instance). It should automatically rewrite dependencies to use the correct packages.

romainguy avatar Sep 05 '18 23:09 romainguy

@romainguy Hi. Jetifier for sceneform seems doesnt work.

dementia2029 avatar Sep 13 '18 06:09 dementia2029

Sorry for the long response time, Is this still an issue in the current release of Sceneform?

malik-at-work avatar Oct 10 '18 17:10 malik-at-work

@romainguy @malik-at-work Hi there. Sceneform still does not work with AndroidX libraries. Jetifier seems does not do its work. So, I cant use materialcomponents + sceneform. This code can not be compiled:

 if(currentFragment==writingArFragment){
   currentFragment.onPause();
}

Error:

Inconvertible types; cannot cast androidx.fragment.app.Fragment to com.google.ar.sceneform.ux.ArFragment

build.gradle:

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.5.1'

gradle.properties:

org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true

calmmycode avatar Dec 05 '18 13:12 calmmycode

Hi. When AndroidX will be added to Sceneform?

kostyabakay avatar Jun 14 '19 11:06 kostyabakay

@abramyan is there anyway to get arFragment working in a normal Activity ? as androidx is not yet supported

M3skar avatar Nov 25 '19 16:11 M3skar

@tpsiaki are there any plans of supporting androidx as google itselfs recommends using androidx for all projects.

kulnaman avatar Mar 27 '20 10:03 kulnaman

I guess this may become serious issue soon as AndroidX is heavily pushed by google now. Any plans for support AndroidX?

Rex1313 avatar Mar 30 '20 23:03 Rex1313

I've opened an issue with my crash details at #1034

ChanduMnS avatar Mar 31 '20 05:03 ChanduMnS