Build with Obfuscation crashes due to Filament
Hi all,
I am getting crash if I enable obfuscation in the project.
Using version 1.20.5
E/Filament: Panic in filament::MaterialParser *filament::createParser(filament::backend::Backend, const void *, size_t):69 reason: Material version mismatch. Expected 17 but received 0.
E/Filament:
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 8292 (.thk.dev), pid 8292 (.thk.dev)
Has anyone faced similar issue?
Hi,
You can have a look in here for excluded rules: https://github.com/SceneView/sceneform-android/blob/master/core/lib-proguard-rules.pro Actually they should already been excluded from your project but I don't know why they are not forwarded form the lib.
Thanks for the fast response Thomas.
Added the two rules:
-keep class com.google.ar.core.** { *; }
-keep class com.google.android.filament.** { *; }
Unfortunately kept the same error.
Are you facing similar issue on your end?
Does this work?
-keep class com.google.ar.sceneform.** { *; }
-keep class com.google.android.filament.** { *; }
-keep class com.google.ar.core.** { *; }
-keepclassmembers class com.google.ar.sceneform.** { *; }
-keepclassmembers class com.google.android.filament.** { *; }
-keepclassmembers class com.google.ar.core.** { *; }
Got the same error @RGregat.
- Can you checkout 1.20.4 and test?
- Is the error thrown without obfuscation?
It can be total unrelated but E/Filament: Panic in filament::MaterialParser *filament::createParser(filament::backend::Backend, const void *, size_t):69 reason: Material version mismatch. Expected 17 but received 0. looks like that the prebuilt materials are generated with a wrong version of Filamat.
- Can you checkout 1.20.4 and test?
Error changed to:
A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 29459 (.thk.dev), pid 29459 (.thk.dev)
E/native: E0228 18:04:33.965109 29898 bundle_adjustment_initializer.cc:704] Measurements not available in all keyframes. At least one keyframe has no features in any of the cameras.
E/native: E0228 18:04:33.967180 29898 vio_initializer.cc:668] generic::internal: [SSBA Initialization] Failed to initialize the network.; Initializer's SSBA failed to produce a valid output.
E/native: E0228 18:04:34.055849 29898 bundle_adjustment_initializer.cc:704] Measurements not available in all keyframes. At least one keyframe has no features in any of the cameras.
- Is the error thrown without obfuscation? Withoug obfuscation, works as expected on both 1.20.4 and 1.20.5 versions.
Sorry, I didn't see the logs. That's not an obfucation issue but a wrong filamat compiled version.
@ThomasGorisse I am not sure but wanted to learn;
if it is a wrong filamat complied version, shouldn't it be crashing on builds without obfuscation too?
Can you provide some code and your obfuscation rules? It looks like if your rules are excluding the .filamat in the asset folder.
-keep class com.google.ar.sceneform.** { *; }
-keep class com.google.android.filament.** { *; }
-keep class com.google.ar.core.** { *; }
-keepclassmembers class com.google.ar.sceneform.** { *; }
-keepclassmembers class com.google.android.filament.** { *; }
-keepclassmembers class com.google.ar.core.** { *; }
Could you please lead me what part of the code you need?
Check your build folder to see the obfuscation result. The asset files should be kept and not compressed.
@ThomasGorisse
I am getting the same error when migrating from 1.20.5 -> 1.21.0
E/Filament: Panic in createParser:69 reason: Material version mismatch. Expected 21 but received 17.
With or without obfuscation result is the same and I don't see anything filament related in build folder.
Do you have any idea?
@tribetomi You must recompile your .filamat files with the corresponding Filament version
@tribetomi You must recompile your .filamat files with the corresponding Filament version
Hey Thomas, yes I realise that but as I said I don't have any additional .mat or .filamat files. I am using library itself without any additional materials and I don't have .filamat in build folder for some reason. On version before everything build smoothly.
Do you override the Filament version in your build.gradle?
No, but I use it as api so I share dependancy in several modules. (in none of them .filament is generated tho)
Yep. But Sceneform has its own internal .filamat files that must be used with the same Filament version.
Hm, I'm aware of that but how can I update them?
As I said I'm only using com.gorisse.thomas.sceneform:sceneform:1.20.5 -> trying 1.21.0 Don't have any other filament dependancy where I set version to 17 or any material that I put manually
Can you try running the sample project corresponding to your use case?
I get the same message :/
The only reason why I'm trying to update it to 1.21.0 is because after reopening ArFragment numerous times I get crash
Skipped image because max images have been acquired from ImageReader. A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 A/DEBUG: Cause: null pointer dereference
and I hope maybe latest version has ImageReader buffer fixed because of https://github.com/google-ar/arcore-android-sdk/issues/1262
It's the bug that you had last year but as I understand after reading sceneform classes is that fix should be also implemented in 1.20.5?
Sorry about that, but all efforts are now made on SceneView and I'm not sure we will fix it on Sceneform
But is SceneView working with AugmentedFace?
I am asking because https://github.com/SceneView/sceneview-android/issues/74 ?
*(sorry for slight off-topic)
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.