giandifra / arcore_flutter_plugin

Flutter plugin for ARCore SDK, Android platform to build new augmented reality experiences
MIT License
433 stars 274 forks source link

Replace Sceneform with the maintained version #166

Open jakub-cosmose opened 2 years ago

jakub-cosmose commented 2 years ago

Google has abandoned Sceneform long time ago. The last version that they released has a lot of problems with rendering glb files created with the current software. There were plans to refactor the plugin to get rid of Sceneform completely, but it's a lot of work and nothing has happened. I think that we should, at least for now, replace the deprecated version of Sceneform with the maintained fork. I've performed the change locally and it works fine. I can make a pull request, if needed.

Saderis commented 2 years ago

Please do make the pull request. I'd like to check it out.

jakub-cosmose commented 2 years ago

I've made a PR https://github.com/giandifra/arcore_flutter_plugin/pull/167/files Unfortunately, this version doesn't support all the features handled by the example app, so making it production ready would require more work, but I think it's a good start. The use case that I use is my app is rendering a glb model downloaded from the network, anchored "in the air" in front of the user, and it works very well. The old version of Sceneform had problems with rendering some textures properly.

KennyChan94P commented 2 years ago

hi @jakub-cosmose , thanks for replace the existing Sceneform with the community-maintained version. but after implementing your version, i have problem running the app to my phone and below are part of my errors:

FAILURE: Build failed with an exception.

and this is how i implement your forked version in my pubspec.yaml:

image

i tried flutter clean and run the app with Android Studio but still getting the errors. looking forward to your reply! Thanks in advance!

KennyChan94P commented 2 years ago

hi @jakub-cosmose , thanks for replace the existing Sceneform with the community-maintained version. but after implementing your version, i have problem running the app to my phone and below are part of my errors:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.google.android.filament.AndroidPlatform found in modules jetified-filament-android-1.15.1-runtime (com.google.android.filament:filament-android:1.15.1) and jetified-filament-android-1.17.1-runtime (com.google.ar.sceneform:filament-android:1.17.1) Duplicate class com.google.android.filament.AndroidPlatform21 found in modules jetified-filament-android-1.15.1-runtime (com.google.android.filament:filament-android:1.15.1) and jetified-filament-android-1.17.1-runtime (com.google.ar.sceneform:filament-android:1.17.1)

and this is how i implement your forked version in my pubspec.yaml: image

i tried flutter clean and run the app with Android Studio but still getting the errors. looking forward to your reply! Thanks in advance!

silly me! im seeing this kind of "Duplicate class" error because im using another plugin ar_flutter_plugin https://pub.dev/packages/ar_flutter_plugin which is still using the old Sceneform. please ignore my previous reply. thank you once again for migrating the Sceneform.

jesulo commented 2 months ago

hi @jakub-cosmose , thanks for replace the existing Sceneform with the community-maintained version. but after implementing your version, i have problem running the app to my phone and below are part of my errors: FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.google.android.filament.AndroidPlatform found in modules jetified-filament-android-1.15.1-runtime (com.google.android.filament:filament-android:1.15.1) and jetified-filament-android-1.17.1-runtime (com.google.ar.sceneform:filament-android:1.17.1) Duplicate class com.google.android.filament.AndroidPlatform21 found in modules jetified-filament-android-1.15.1-runtime (com.google.android.filament:filament-android:1.15.1) and jetified-filament-android-1.17.1-runtime (com.google.ar.sceneform:filament-android:1.17.1)

and this is how i implement your forked version in my pubspec.yaml: image i tried flutter clean and run the app with Android Studio but still getting the errors. looking forward to your reply! Thanks in advance!

silly me! im seeing this kind of "Duplicate class" error because im using another plugin ar_flutter_plugin https://pub.dev/packages/ar_flutter_plugin which is still using the old Sceneform. please ignore my previous reply. thank you once again for migrating the Sceneform.

This can working for ar_flutter_plugin?