I have a big problem with my app. It crashes and I don't know why.
In my app I have a Activity
with a listview
and a customlistviewadapter
and a second Detailactivity
.
I want to add the material design from Android Lollipop and there is my problem. I added the nice Activity Transaction between the two Activities
.
I'm taking the picture and the title from the listviewelement out of the listview and using a SparseArray<Bitmap>
to transfer the picture, a intent
and ActivityOptions
to transfer the rest of my data.
The Transaction from my first Activity
to the DetailActivity
works fine. At my DetailActivity
I have to load more data, one of this is a description.
The description text have \n tags for new line and sometimes also xhtml tags.
To get rid of \n tags I'm using String mdesc = text.replace("\n", "<br />");
.
So now I have only xhtml tags and to make it look nice in my textview I use this line description.setText(Html.fromHtml(mdesc));
.
Also works like charm, but if I click the back button the app crashes when the number of chars in the description are higher than ~3800.
This is my logcat:
A/art﹕ art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI CallVoidMethodV called with pending exception 'java.lang.IllegalStateException' thrown in void android.os.MessageQueue.nativePollOnce(long, i
A/art﹕ art/runtime/check_jni.cc:65] in call to CallVoidMethodV
A/art﹕ art/runtime/check_jni.cc:65] from void android.os.MessageQueue.nativePollOnce(long, int)
A/art﹕ art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
A/art﹕ art/runtime/check_jni.cc:65] | group="main" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/check_jni.cc:65] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/check_jni.cc:65] | state=R schedstat=( 285569518384 174632061067 1598010 ) utm=17211 stm=11345 core=0 HZ=100
A/art﹕ art/runtime/check_jni.cc:65] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/check_jni.cc:65] | held mutexes= "mutator lock"(shared held)
A/art﹕ art/runtime/check_jni.cc:65] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/check_jni.cc:65] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/check_jni.cc:65] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/check_jni.cc:65] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/check_jni.cc:65] native: #04 pc 000b1195 /system/lib/libart.so (art::JniAbort(char const*, char const*)+620)
A/art﹕ art/runtime/check_jni.cc:65] native: #05 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/check_jni.cc:65] native: #06 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/check_jni.cc:65] native: #07 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/check_jni.cc:65] native: #08 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/check_jni.cc:65] native: #09 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/check_jni.cc:65] native: #10 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/check_jni.cc:65] native: #11 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/check_jni.cc:65] native: #12 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/check_jni.cc:65] native: #13 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/check_jni.cc:65] native: #14 pc 000b0de7 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/check_jni.cc:65] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/check_jni.cc:65] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/check_jni.cc:65] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/check_jni.cc:65] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/check_jni.cc:65]
A/art﹕ art/runtime/runtime.cc:283] Runtime aborting...
A/art﹕ art/runtime/runtime.cc:283] Aborting thread:
A/art﹕ art/runtime/runtime.cc:283] "main" prio=9 tid=1 Native
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/runtime.cc:283] | state=R schedstat=( 285595822403 174647533456 1598201 ) utm=17213 stm=11346 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes= "abort lock" "mutator lock"(shared held)
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 0022c6a9 /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+32)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 0022c94b /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+410)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 0022cb0b /system/lib/libart.so (art::Runtime::Abort()+82)
A/art﹕ art/runtime/runtime.cc:283] native: #07 pc 000a7269 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
A/art﹕ art/runtime/runtime.cc:283] native: #08 pc 000b1381 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1112)
A/art﹕ art/runtime/runtime.cc:283] native: #09 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/runtime.cc:283] native: #10 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/runtime.cc:283] native: #11 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/runtime.cc:283] native: #12 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/runtime.cc:283] native: #13 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/runtime.cc:283] native: #14 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/runtime.cc:283] native: #15 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/runtime.cc:283] native: #16 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/runtime.cc:283] native: #17 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/runtime.cc:283] native: #18 pc 000b0de7 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283] Pending exception java.lang.IllegalStateException thrown by 'void android.os.MessageQueue.nativePollOnce(long, int):-2'
A/art﹕ art/runtime/runtime.cc:283] java.lang.IllegalStateException: Unable to create layer for TextView
A/art﹕ art/runtime/runtime.cc:283] at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at void android.os.Looper.loop() (Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[], boolean) (Method.java:-2)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283] Dumping all threads without appropriate locks held: thread list lock mutator lock
A/art﹕ art/runtime/runtime.cc:283] All threads:
A/art﹕ art/runtime/runtime.cc:283] DALVIK THREADS (52):
A/art﹕ art/runtime/runtime.cc:283] "main" prio=9 tid=1 Native
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x737d5ec0 self=0xb5007800
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31960 nice=-6 cgrp=apps sched=0/0 handle=0xb6f40ec8
A/art﹕ art/runtime/runtime.cc:283] | state=R schedstat=( 285618908185 174654076164 1598229 ) utm=17214 stm=11347 core=0 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xbe3ad000-0xbe3af000 stackSize=8MB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes= "abort lock"
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00004c58 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000034c1 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0025918d /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+84)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 0023cd13 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+162)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 00245ea5 /system/lib/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+120)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 0022c8c1 /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+272)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 0022cb0b /system/lib/libart.so (art::Runtime::Abort()+82)
A/art﹕ art/runtime/runtime.cc:283] native: #07 pc 000a7269 /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
A/art﹕ art/runtime/runtime.cc:283] native: #08 pc 000b1381 /system/lib/libart.so (art::JniAbort(char const*, char const*)+1112)
A/art﹕ art/runtime/runtime.cc:283] native: #09 pc 000b18c5 /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
A/art﹕ art/runtime/runtime.cc:283] native: #10 pc 000b4b4d /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
A/art﹕ art/runtime/runtime.cc:283] native: #11 pc 000bcf23 /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+42)
A/art﹕ art/runtime/runtime.cc:283] native: #12 pc 00060ad3 /system/lib/libandroid_runtime.so (???)
A/art﹕ art/runtime/runtime.cc:283] native: #13 pc 0007474d /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long long, int, unsigned int)+40)
A/art﹕ art/runtime/runtime.cc:283] native: #14 pc 00074915 /system/lib/libandroid_runtime.so (android::NativeDisplayEventReceiver::handleEvent(int, int, void*)+80)
A/art﹕ art/runtime/runtime.cc:283] native: #15 pc 00012545 /system/lib/libutils.so (android::Looper::pollInner(int)+484)
A/art﹕ art/runtime/runtime.cc:283] native: #16 pc 000125ed /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
A/art﹕ art/runtime/runtime.cc:283] native: #17 pc 0007fb61 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
A/art﹕ art/runtime/runtime.cc:283] native: #18 pc 000b0de7 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.nativePollOnce(Native method)
A/art﹕ art/runtime/runtime.cc:283] at android.os.MessageQueue.next(MessageQueue.java:143)
A/art﹕ art/runtime/runtime.cc:283] at android.os.Looper.loop(Looper.java:122)
A/art﹕ art/runtime/runtime.cc:283] at android.app.ActivityThread.main(ActivityThread.java:5221)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke!(Native method)
A/art﹕ art/runtime/runtime.cc:283] at java.lang.reflect.Method.invoke(Method.java:372)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
A/art﹕ art/runtime/runtime.cc:283] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
A/art﹕ art/runtime/runtime.cc:283]
A/art﹕ art/runtime/runtime.cc:283] "Heap thread pool worker thread 0" prio=9 tid=2 Native (still starting up)
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x0 self=0xafe0e400
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31966 nice=0 cgrp=apps sched=0/0 handle=0xac5a1a00
A/art﹕ art/runtime/runtime.cc:283] | state=S schedstat=( 879428 6643385 8 ) utm=0 stm=0 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xb4847000-0xb4849000 stackSize=1020KB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes=
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00012e98 /system/lib/libc.so (syscall+28)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000a9fa3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+98)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0024714d /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+64)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 002470e7 /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 002479d5 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+60)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 000162e3 /system/lib/libc.so (__pthread_start(void*)+30)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 000142d3 /system/lib/libc.so (__start_thread+6)
A/art﹕ art/runtime/runtime.cc:283] (no managed stack frames)
A/art﹕ art/runtime/runtime.cc:283]
A/art﹕ art/runtime/runtime.cc:283] "Heap thread pool worker thread 2" prio=9 tid=3 Native (still starting up)
A/art﹕ art/runtime/runtime.cc:283] | group="" sCount=0 dsCount=0 obj=0x0 self=0xafb0e400
A/art﹕ art/runtime/runtime.cc:283] | sysTid=31968 nice=0 cgrp=apps sched=0/0 handle=0xac5a1f00
A/art﹕ art/runtime/runtime.cc:283] | state=S schedstat=( 739842 1013075 7 ) utm=0 stm=0 core=1 HZ=100
A/art﹕ art/runtime/runtime.cc:283] | stack=0xb4645000-0xb4647000 stackSize=1020KB
A/art﹕ art/runtime/runtime.cc:283] | held mutexes=
A/art﹕ art/runtime/runtime.cc:283] native: #00 pc 00012e98 /system/lib/libc.so (syscall+28)
A/art﹕ art/runtime/runtime.cc:283] native: #01 pc 000a9fa3 /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+98)
A/art﹕ art/runtime/runtime.cc:283] native: #02 pc 0024714d /system/lib/libart.so (art::ThreadPool::GetTask(art::Thread*)+64)
A/art﹕ art/runtime/runtime.cc:283] native: #03 pc 002470e7 /system/lib/libart.so (art::ThreadPoolWorker::Run()+62)
A/art﹕ art/runtime/runtime.cc:283] native: #04 pc 002479d5 /system/lib/libart.so (art::ThreadPoolWorker::Callback(void*)+60)
A/art﹕ art/runtime/runtime.cc:283] native: #05 pc 000162e3 /system/lib/libc.so (__pthread_start(void*)+30)
A/art﹕ art/runtime/runtime.cc:283] native: #06 pc 000142d3 /system/lib/libc.so (__start_thread+6)
A/art﹕ art/runtime/runtime.cc:283] (no managed stack frames)
I couldn't add the whole logcat so I pasted the rest on pastebin. The link to pastebin is here.
Thanks for your help!
I had this issue in Genymotion, AndroidStudio emulator, couple of real devices.
My logs were a bit different
but it is not the point.
This issue happens during shared element transition, and the main reason is because it is pre-rendering target activity (one where your shared transition ends).
So if this activity is really big (with couple of screens of scrollable text or long grid with images as in my case) you will get this error.
Solution:
Paginate your content and load no more than 1-1.5 screens of content at a time.
This will significantly decrease the screen size that is being pre-rendered during shared elements transition (it's being pre-rendered every time so the system knows where to place your transition object after transition)
The best solution as it was pointed out in other answers is to add:
android:transitionGroup="true"
to the long view (usually ScrollView of some kind).As for the transition listener approach, don't forget to re-create your view on rotation when there were no shared animations.
As I still need to support everything down to Android version 9, neither
android:transitionGroup="true"
nor usingTransitionListener
would work for me. I could prevent the problem by disabling hardware acceleration on Activity level:Disabling it on a view level didn't work for me, but might work for others:
I had the same issue, I found a way to avoid the crash. You can just change the return-transition to others instead of fade, such as: explode/move/slide/...
To do that you can just add
to your apptheme file.
If you take a look at your logs, immediately above the stack trace you'll probably see a warning similar to:
Scene animations work by creating a bitmap layer of the target scene. The GPU has a maximum capacity for this layer. On a Nexus 5 this is 4096x4096. Your target scene has views in it which result in a layer which is too large, probably due to the large amounts of text content. This exceeds the capacity of the GPU causing the app to crash. The reason why this doesn't occur on the emulator is because the host GPU has a greater memory.
Solution
Avoid creating a target layer which is higher than 4096 before the transition animation ends. Instead load your content after the transition ends. You can listen for the transition ended event by implementing the TransitionListener interface. An example of this can be found here. You can then load your content.