I get a really strange error. I have a very simple Fragment in Android that should just display an imageView that I created using Inkscape whose name is "test_v1" and which is a png file.
The XML code looks like this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView2"
android:layout_width="200dp"
android:layout_height="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/test_v1" />
</androidx.constraintlayout.widget.ConstraintLayout>
The Java code looks like this:
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
public class FR_Test extends Fragment {
public FR_Test() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_test, container, false);
}
}
When running the code (using 2 different emulators), I get a strange rendering error:
2023-12-22 15:58:21.791 11047-11069 OpenGLRenderer com.example.td.barapp E GL error: GL_INVALID_OPERATION
2023-12-22 15:58:21.791 11047-11069 OpenGLRenderer com.example.td.barapp A GL errors! frameworks/base/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp:127
2023-12-22 15:58:21.976 11047-11069 ample.td.barap com.example.td.barapp A runtime.cc:655] Runtime aborting...
runtime.cc:655] Dumping all threads without mutator lock held
runtime.cc:655] All threads:
runtime.cc:655] DALVIK THREADS (20):
runtime.cc:655] "RenderThread" prio=10 tid=18 Runnable
runtime.cc:655] | group="" sCount=0 dsCount=0 flags=0 obj=0x134806d8 self=0xddb0ee10
runtime.cc:655] | sysTid=11069 nice=-10 cgrp=top-app sched=0/0 handle=0xbc8ba1e0
runtime.cc:655] | state=R schedstat=( 1191413791 89741236 664 ) utm=5 stm=114 core=1 HZ=100
runtime.cc:655] | stack=0xbc7bf000-0xbc7c1000 stackSize=1008KB
runtime.cc:655] | held mutexes= "abort lock" "mutator lock"(shared held)
runtime.cc:655] native: #00 pc 00544bfe /apex/com.android.art/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+110)
runtime.cc:655] native: #01 pc 006a26f7 /apex/com.android.art/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+1015)
runtime.cc:655] native: #02 pc 0069bfd1 /apex/com.android.art/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+65)
runtime.cc:655] native: #03 pc 006c8014 /apex/com.android.art/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+1172)
runtime.cc:655] native: #04 pc 006c10c6 /apex/com.android.art/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+630)
runtime.cc:655] native: #05 pc 006c002e /apex/com.android.art/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+2446)
runtime.cc:655] native: #06 pc 006540dd /apex/com.android.art/lib/libart.so (art::AbortState::DumpAllThreads(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*) const+445)
runtime.cc:655] native: #07 pc 0063b6af /apex/com.android.art/lib/libart.so (art::Runtime::Abort(char const*)+1967)
runtime.cc:655] native: #08 pc 00025a23 /apex/com.android.art/lib/libartbase.so (std::__1::__function::__func<void (*)(char const*), std::__1::allocator<void (*)(char const*)>, void (char const*)>::operator()(char const*&&)+35)
runtime.cc:655] native: #09 pc 0001588f /system/lib/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+79)
runtime.cc:655] native: #10 pc 00006dbd /system/lib/liblog.so (__android_log_assert+285)
runtime.cc:655] native: #11 pc 0024dd11 /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::swapBuffers(android::uirenderer::renderthread::Frame const&, bool, SkRect const&, android::uirenderer::FrameInfo*, bool*)+145)
runtime.cc:655] native: #12 pc 00257e78 /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+1112)
runtime.cc:655] native: #13 pc 0025ab5f /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+767)
runtime.cc:655] native: #14 pc 0024542d /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+285)
runtime.cc:655] native: #15 pc 0026cabf /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+127)
runtime.cc:655] native: #16 pc 00015116 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+374)
runtime.cc:655] native: #17 pc 000147d9 /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+457)
runtime.cc:655] native: #18 pc 000e6974 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100)
runtime.cc:655] native: #19 pc 00078567 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71)
runtime.cc:655] (no managed stack frames)
runtime.cc:655]
runtime.cc:655] "main" prio=10 tid=1 Native
runtime.cc:655] | group="" sCount=1 dsCount=0 flags=1 obj=0x71e742e0 self=0xddb06210
2023-12-22 15:58:21.976 11047-11069 ample.td.barap com.example.td.barapp A runtime.cc:655] | sysTid=11047 nice=-10 cgrp=top-app sched=0/0 handle=0xec08f478
runtime.cc:655] | state=S schedstat=( 1445030526 396377813 944 ) utm=78 stm=66 core=3 HZ=100
runtime.cc:655] | stack=0xff41b000-0xff41d000 stackSize=8192KB
runtime.cc:655] | held mutexes=
runtime.cc:655] native: #00 pc 00000b97 [vdso] (__kernel_vsyscall+7)
runtime.cc:655] native: #01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40)
runtime.cc:655] native: #02 pc 0007725e /apex/com.android.runtime/lib/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+142)
runtime.cc:655] native: #03 pc 000e5b2e /apex/com.android.runtime/lib/bionic/libc.so (pthread_cond_wait+62)
runtime.cc:655] native: #04 pc 0025a146 /system/lib/libhwui.so (android::uirenderer::renderthread::DrawFrameTask::postAndWait()+182)
runtime.cc:655] native: #05 pc 0023922d /system/lib/libhwui.so (android::android_view_ThreadedRenderer_syncAndDrawFrame(_JNIEnv*, _jobject*, long long, _jlongArray*, int)+109)
runtime.cc:655] at android.graphics.HardwareRenderer.nSyncAndDrawFrame(Native method)
runtime.cc:655] at android.graphics.HardwareRenderer.syncAndDrawFrame(HardwareRenderer.java:433)
runtime.cc:655] at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:658)
runtime.cc:655] at android.view.ViewRootImpl.draw(ViewRootImpl.java:4101)
runtime.cc:655] at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3828)
runtime.cc:655] at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3099)
runtime.cc:655] at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
runtime.cc:655] at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8171)
runtime.cc:655] at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
runtime.cc:655] at android.view.Choreographer.doCallbacks(Choreographer.java:796)
runtime.cc:655] at android.view.Choreographer.doFrame(Choreographer.java:731)
runtime.cc:655] at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
runtime.cc:655] at android.os.Handler.handleCallback(Handler.java:938)
runtime.cc:655] at android.os.Handler.dispatchMessage(Handler.java:99)
runtime.cc:655] at android.os.Looper.loop(Looper.java:223)
runtime.cc:655] at android.app.ActivityThread.main(ActivityThread.java:7656)
runtime.cc:655] at java.lang.reflect.Method.invoke(Native method)
runtime.cc:655] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
runtime.cc:655] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
runtime.cc:655]
runtime.cc:655] "Signal Catcher" prio=10 tid=6 WaitingInMainSignalCatcherLoop
runtime.cc:655] | group="" sCount=1 dsCount=0 flags=1 obj=0x13480228 self=0xddb07e10
runtime.cc:655] | sysTid=11057 nice=-20 cgrp=top-app sched=0/0 handle=0xd2e121e0
runtime.cc:655] | state=S schedstat=( 1135270 51894 1 ) utm=0 stm=0 core=1 HZ=100
runtime.cc:655] | stack=0xd2d17000-0xd2d19000 stackSize=1008KB
runtime.cc:655] | held mutexes=
runtime.cc:655] native: #00 pc 00000b99 [vdso] (__kernel_vsyscall+9)
runtime.cc:655] native: #01 pc 000ce821 /apex/com.android.runtime/lib/bionic/libc.so (__rt_sigtimedwait+33)
runtime.cc:655] native: #02 pc 00086c55 /apex/com.android.runtime/lib/bionic/libc.so (sigwait+69)
runtime.cc:655] native: #03 pc 00667d7d /apex/com.android.art/lib/libart.so (art::SignalCatcher::WaitForSignal(art::Thread*, art::SignalSet&)+461)
runtime.cc:655] native: #04 pc 0066675f /apex/com.android.art/lib/libart.so (art::SignalCatcher::Run(void*)+479)
runtime.cc:655] native: #05 pc 000e6974 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100)
runtime.cc:655] native: #06 pc 00078567 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71)
runtime.cc:655] (no managed stack frames)
runtime.cc:655]
runtime.cc:655] "perfetto_hprof_listener" prio=10 tid=7 Native (still starting up)
2023-12-22 15:58:21.976 11047-11069 ample.td.barap com.example.td.barapp A runtime.cc:655] | group="" sCount=1 dsCount=0 flags=1 obj=0x0 self=0xddb09a10
runtime.cc:655] | sysTid=11058 nice=-20 cgrp=top-app sched=0/0 handle=0xd2d111e0
runtime.cc:655] | state=S schedstat=( 985039 0 1 ) utm=0 stm=0 core=1 HZ=100
runtime.cc:655] | stack=0xd2c16000-0xd2c18000 stackSize=1008KB
runtime.cc:655] | held mutexes=
runtime.cc:655] native: #00 pc 00000b97 [vdso] (__kernel_vsyscall+7)
runtime.cc:655] native: #01 pc 000ccf9c /apex/com.android.runtime/lib/bionic/libc.so (read+28)
runtime.cc:655] native: #02 pc 0001aca2 /apex/com.android.art/lib/libperfetto_hprof.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, ArtPlugin_Initialize::$_29> >(void*)+306)
runtime.cc:655] native: #03 pc 000e6974 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100)
runtime.cc:655] native: #04 pc 00078567 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71)
runtime.cc:655] (no managed stack frames)
runtime.cc:655]
runtime.cc:655] "ADB-JDWP Connection Control Thread" prio=10 tid=8 WaitingInMainDebuggerLoop
runtime.cc:655] | group="" sCount=1 dsCount=0 flags=1 obj=0x134802a0 self=0xddb04610
runtime.cc:655] | sysTid=11059 nice=-20 cgrp=top-app sched=0/0 handle=0xd2c101e0
runtime.cc:655] | state=S schedstat=( 5383975 12206480 17 ) utm=0 stm=0 core=1 HZ=100
runtime.cc:655] | stack=0xd2b15000-0xd2b17000 stackSize=1008KB
runtime.cc:655] | held mutexes=
runtime.cc:655] native: #00 pc 00000b99 [vdso] (__kernel_vsyscall+9)
runtime.cc:655] native: #01 pc 000cf496 /apex/com.android.runtime/lib/bionic/libc.so (__ppoll+38)
The really strange thing is that when I open the png file with MS paint and just draw one pixel (that you can't even see) and give the file another name "test_v2", the problem does not occur. Here you can see "test_v2"

Reminder: Can anyone explain this very weird behaviour or at least try to explain it?
