I am following this guide and this sample for creating a Sceneform application.
I want to create a widget with ViewRenderable & add it to the scene, but the app crashes when build() is called.
ViewRenderable.builder()
.setView(this, R.layout.widget)
.build() // App crashes here!
.thenAccept(viewRenderable -> {
..
}).exceptionally(
throwable -> {
System.out.println(throwable.getStackTrace());
return null;
});
This is the layout file widget.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="HELLO"/>
</LinearLayout>
I tried to catch an exception with a try-catch block, but the app simply crashes. The only thing I can see in the logcat is this output:
2020-04-12 23:41:18.912 23444-23444/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-04-12 23:41:18.912 23444-23444/? A/DEBUG: Build fingerprint: 'HUAWEI/CLT-L29/HWCLT:9/HUAWEICLT-L29/9.1.0.387C432:user/release-keys'
2020-04-12 23:41:18.912 23444-23444/? A/DEBUG: Revision: '0'
2020-04-12 23:41:18.912 23444-23444/? A/DEBUG: ABI: 'arm64'
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: Happend: 'Sun Apr 12 23:41:18 2020
'
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: SYSVMTYPE: Art
APPVMTYPE: Art
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: pid: 23350, tid: 23350, name: rm.samples.gltf >>> com.google.ar.sceneform.samples.gltf <<<
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: Cause: null pointer dereference
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x0 0000000000000000 x1 00000000000026e6 x2 0000007c44ae36a0 x3 0000000000000008
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x4 0000000000000000 x5 0000007c60c0e000 x6 0000007c60c15ca0 x7 0000007ce75b05e0
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x8 0000007c4457f2f0 x9 0000007c3fc00000 x10 0000000000000000 x11 0000000000000000
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x12 0000007c60c0e748 x13 0000000000000001 x14 0000007c4457f1e8 x15 ffffffffffffffff
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x16 0000007ce36f2bd8 x17 0000007ce3686d48 x18 0000007c450e3183 x19 00000000000026e6
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x20 0000007c5a252f60 x21 0000007fc0432b58 x22 000000000000c09a x23 0000000000000000
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x24 0000000000000010 x25 0000007ce75b05e0 x26 0000007c60c15ca0 x27 0000000000000004
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: x28 0000007fc0432c00 x29 0000007fc0432c00
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: sp 0000007fc0432af0 lr 0000007c4449949c pc 0000007c44492108
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: backtrace:
2020-04-12 23:41:18.913 23444-23444/? A/DEBUG: #00 pc 0000000000092108 /data/app/com.google.ar.sceneform.samples.gltf-jNipqK5CUNDrfOaehjPQgQ==/lib/arm64/libgltfio-jni.so