sceneform-android-sdk
sceneform-android-sdk copied to clipboard
AndroidX support
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
ThanX for letting us know. We'll look into it.
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 Hi. Jetifier for sceneform seems doesnt work.
Sorry for the long response time, Is this still an issue in the current release of Sceneform?
@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
Hi. When AndroidX will be added to Sceneform?
@abramyan is there anyway to get arFragment working in a normal Activity
?
as androidx is not yet supported
@tpsiaki are there any plans of supporting androidx as google itselfs recommends using androidx for all projects.
I guess this may become serious issue soon as AndroidX is heavily pushed by google now. Any plans for support AndroidX?
I've opened an issue with my crash details at #1034