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

Models can't be rendered from file (using RenderableSource) after enabling Firebase Performance plugin #722

Open VMitin opened 5 years ago

VMitin commented 5 years ago

Hi there!

I have implemented some app based on Scenform SDK and now have the problem with installing Firebase Performance Plugin.

My code downloading the glb-file from back-end into the cache folder. After that I making Uri using code like this Uri.fromFile(localAsset)

And making RenderableSource class val source = RenderableSource .builder() .setSource(context, uri, RenderableSource.SourceType.GLB) .build()

All works fine but after enabling Firebase Performance Plugin (apply plugin: 'com.google.firebase.firebase-perf' in the build.gradle) I received the exception:

2019-06-03 19:31:36.828 7893-7976/com.example.app E/EntitiesKt$asRenderable: Unable to load model renderable 2019-06-03 19:31:36.828 7893-7976/com.example.app E/EntitiesKt$asRenderable: java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/sceneform_assets/A; 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:276) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:282) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.lang.Thread.run(Thread.java:764) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/sceneform_assets/A; 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.sceneform_assets.y.(Unknown Source:0) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.sceneform_assets.y.a(Unknown Source:0) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.ar.sceneform.assets.RenderableSource.call(Unknown Source:0) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.ar.sceneform.assets.RenderableSource.call(Unknown Source:0) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.ar.sceneform.rendering.LoadRenderableFromSfbTask.inputStreamToByteBuffer(LoadRenderableFromSfbTask.java:178) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.ar.sceneform.rendering.LoadRenderableFromSfbTask.lambda$downloadAndProcessRenderable$0$LoadRenderableFromSfbTask(LoadRenderableFromSfbTask.java:113) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromSfbTask$0DkaOpfpmr8DYlbaxWogZtUpKTw.get(Unknown Source:4) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1625) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: ... 3 more 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.sceneform_assets.A" on path: DexPathList[[zip file "/data/app/com.example.app-qXua1PePb5rTLnVQb-AZdw==/base.apk", zip file "/data/app/com.example.app-qXua1PePb5rTLnVQb-AZdw==/split_lib_dependencies_apk.apk»…2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: ... 11 more 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: Suppressed: java.io.IOException: No original dex files found for dex location /data/app/com.example.app-qXua1PePb5rTLnVQb-AZdw==/split_lib_resources_apk.apk 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexFile.openDexFileNative(Native Method) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexFile.openDexFile(DexFile.java:354) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexFile.(DexFile.java:101) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexFile.(DexFile.java:75) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.DexPathList.(DexPathList.java:164) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:74) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:65) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at dalvik.system.PathClassLoader.(PathClassLoader.java:64) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.LoadedApk.getClassLoader(LoadedApk.java:810) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.LoadedApk.getResources(LoadedApk.java:1032) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ContextImpl.createAppContext(ContextImpl.java:2345) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5798) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ActivityThread.access$1100(ActivityThread.java:200) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.os.Handler.dispatchMessage(Handler.java:106) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.os.Looper.loop(Looper.java:193) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at android.app.ActivityThread.main(ActivityThread.java:6718) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at java.lang.reflect.Method.invoke(Native Method) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 2019-06-03 19:31:36.829 7893-7976/com.example.app E/EntitiesKt$asRenderable: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

tellypresence commented 4 years ago

Do you have the option of exporting models as .fbx and testing, just to try to isolate whether the raw model format might be contributing cause?

(I have firebase performance plugin activated and use .fbx for sceneForm conversion without issues)