google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

AndroidX support #295

Open dementia2029 opened 6 years ago

dementia2029 commented 6 years ago

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

abramyan commented 6 years ago

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

romainguy commented 6 years ago

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.

dementia2029 commented 6 years ago

@romainguy Hi. Jetifier for sceneform seems doesnt work.

malik-at-work commented 6 years ago

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

calmmycode commented 5 years ago

@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
kostyabakay commented 5 years ago

Hi. When AndroidX will be added to Sceneform?

M3skar commented 4 years ago

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

kulnaman commented 4 years ago

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

Rex1313 commented 4 years ago

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

ChanduMnS commented 4 years ago

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