Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android App crashes using Unity IAP 1.21.0

Discussion in 'Unity IAP' started by jreed-curious, Sep 11, 2018.

  1. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    We are experiencing frequent crashes on our current Android release candidate for the Google Play Store.

    We have isolated the commit and determined that it is indeed being caused by upgrading Unity IAP from 1.20.0 to 1.21.0. Rolling back to Unity IAP 1.20.0 fixes the issue.

    It is only happening on our Android version of the app, targeting the Google Play Store (we do not publish to the Amazon App Store). It is not happening with our iOS App Store version of the app.

    It occurs when lots of Sprites are being loaded and used. For example: during an end of level animation we render a particle explosion that uses a lot of
    Sprites
    ; or when paging quickly through the user's inventory which also loads a lot
    Sprites
    .

    It's possible it's related to higher memory usage, though we are not seeing the
    Application.LowMemory
    callback being triggered before the crash.

    We are using Unity 2017.1.3p1

    I'm not seeing anything interesting in the verbose logs before just before the crash. I'm only seeing what our app is logging.

    19141 19177 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
    19141 19177 W google-breakpad: Chrome build fingerprint:
    19141 19177 W google-breakpad: 69.0.3497.86
    19141 19177 W google-breakpad: 349708652
    19141 19177 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
    19141 19177 F ious.wordgeniu: indirect_reference_table.cc:59] JNI ERROR (app bug): accessed stale Local 0x1 (index 0 in a table of size 0)
    19141 19169 I Unity : TrackEvent: CardWalletScreenView.World:cubicle-life, [no data]
    19141 19169 I Unity :
    19141 19169 I Unity : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    19141 19169 I Unity :
    19141 19177 F ious.wordgeniu: runtime.cc:558] Runtime aborting...
    19141 19177 F ious.wordgeniu: runtime.cc:558] Dumping all threads without appropriate locks held: thread list lock
    19141 19177 F ious.wordgeniu: runtime.cc:558] All threads:
    19141 19177 F ious.wordgeniu: runtime.cc:558] DALVIK THREADS (64):
    19141 19177 F ious.wordgeniu: runtime.cc:558] "Thread-297" prio=5 tid=64 Runnable
    19141 19177 F ious.wordgeniu: runtime.cc:558] | group="" sCount=0 dsCount=0 flags=0 obj=0x13440000 self=0xc6a7dc00
    19141 19177 F ious.wordgeniu: runtime.cc:558] | sysTid=19177 nice=0 cgrp=default sched=0/0 handle=0xca1ff970
    19141 19177 F ious.wordgeniu: runtime.cc:558] | state=R schedstat=( 123416347 17754068 178 ) utm=4 stm=7 core=3 HZ=100
    19141 19177 F ious.wordgeniu: runtime.cc:558] | stack=0xca100000-0xca102000 stackSize=1026KB
    19141 19177 F ious.wordgeniu: runtime.cc:558] | held mutexes= "abort lock" "mutator lock"(shared held)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #00 pc 002d975f /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+134)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #01 pc 0036e98b /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+210)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #02 pc 0036b143 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+34)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #03 pc 00383df9 /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+624)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #04 pc 0037e0df /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+314)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #05 pc 0037d65b /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+378)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #06 pc 0034d8fb /system/lib/libart.so (art::Runtime::Abort(char const*)+314)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #07 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #08 pc 001b69b5 /system/lib/libart.so (art::IndirectReferenceTable::AbortIfNoCheckJNI(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)+172)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #09 pc 0023752f /system/lib/libart.so (art::IndirectReferenceTable::GetChecked(void*) const+270)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #10 pc 003731d7 /system/lib/libart.so (art::Thread::DecodeJObject(_jobject*) const+54)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #11 pc 003486ab /system/lib/libart.so (art::(anonymous namespace)::ArgArray::BuildArgArrayFromJValues(art::ScopedObjectAccessAlreadyRunnable const&, art::ObjPtr<art::mirror::Object>, jvalue*)+138)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #12 pc 00348533 /system/lib/libart.so (art::InvokeWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+294)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #13 pc 0028599f /system/lib/libart.so (art::JNI::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue*)+446)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #14 pc 00aca514 /data/app/com.curious.wordgenius-ETCWu9Rc16npzlRhWeH7jg==/lib/arm/libunity.so (???)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #15 pc 0001481e <anonymous:e622e000> (???)
    19141 19177 F ious.wordgeniu: runtime.cc:558] (no managed stack frames)

    << OMITTED SEE ATTACHED LOGFILE >>

    19141 19177 F ious.wordgeniu: runtime.cc:558]
    19141 19177 F ious.wordgeniu: runtime.cc:558] Aborting thread:
    19141 19177 F ious.wordgeniu: runtime.cc:558] | stack=0xca100000-0xca102000 stackSize=1026KB
    19141 19177 F ious.wordgeniu: runtime.cc:558] | held mutexes= "abort lock" "mutator lock"(shared held)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #01 pc 0036e98b /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+210)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #04 pc 0034db57 /system/lib/libart.so (art::Runtime::Abort(char const*)+918)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #05 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #09 pc 003486ab /system/lib/libart.so (art::(anonymous namespace)::ArgArray::BuildArgArrayFromJValues(art::ScopedObjectAccessAlreadyRunnable const&, art::ObjPtr<art::mirror::Object>, jvalue*)+138)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #12 pc 00aca514 /data/app/com.curious.wordgenius-ETCWu9Rc16npzlRhWeH7jg==/lib/arm/libunity.so (???)
    19141 19177 F ious.wordgeniu: runtime.cc:558] native: #13 pc 0001481e <anonymous:e622e000> (???)
    19141 19177 F libc : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 19177 (Thread-297), pid 19141 (ious.wordgenius)
    19468 19468 E DEBUG : failed to readlink /proc/19177/fd/145: No such file or directory
    19468 19468 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
    730 730 I /system/bin/tombstoned: received crash request for pid 19177
    19468 19468 I crash_dump32: performing dump of process 19141 (target tid = 19177)
    19468 19468 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    19468 19468 F DEBUG : Build fingerprint: 'google/sailfish/sailfish:9/PPR2.180905.006/4945130:user/release-keys'
    19468 19468 F DEBUG : Revision: '0'
    19468 19468 F DEBUG : ABI: 'arm'
    19468 19468 F DEBUG : pid: 19141, tid: 19177, name: Thread-297 >>> com.curious.wordgenius <<<
    19468 19468 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    19468 19468 F DEBUG : Abort message: 'indirect_reference_table.cc:59] JNI ERROR (app bug): accessed stale Local 0x1 (index 0 in a table of size 0)'
    19468 19468 F DEBUG : r0 00000000 r1 00004ae9 r2 00000006 r3 00000008
    19468 19468 F DEBUG : r4 00004ac5 r5 00004ae9 r6 ca1fee2c r7 0000010c
    19468 19468 F DEBUG : r8 00000000 r9 cdcbcfa7 r10 00000000 r11 ca1ff128
    19468 19468 F DEBUG : ip ca1fedc8 sp ca1fee18 lr e8868f19 pc e8860d66
    19468 19468 F DEBUG :
    19468 19468 F DEBUG : backtrace:
    19468 19468 F DEBUG : #00 pc 0001cd66 /system/lib/libc.so (abort+58)
    19468 19468 F DEBUG : #01 pc 0034db4f /system/lib/libart.so (art::Runtime::Abort(char const*)+910)
    19468 19468 F DEBUG : #02 pc 000071b3 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+494)
    19468 19468 F DEBUG : #03 pc 001b69b5 /system/lib/libart.so (art::IndirectReferenceTable::AbortIfNoCheckJNI(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)+172)
    19468 19468 F DEBUG : #04 pc 0023752f /system/lib/libart.so (art::IndirectReferenceTable::GetChecked(void*) const+270)
    19468 19468 F DEBUG : #05 pc 003731d7 /system/lib/libart.so (art::Thread::DecodeJObject(_jobject*) const+54)
    19468 19468 F DEBUG : #06 pc 003486ab /system/lib/libart.so (art::(anonymous namespace)::ArgArray::BuildArgArrayFromJValues(art::ScopedObjectAccessAlreadyRunnable const&, art::ObjPtr<art::mirror::Object>, jvalue*)+138)
    19468 19468 F DEBUG : #07 pc 00348533 /system/lib/libart.so (art::InvokeWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+294)
    19468 19468 F DEBUG : #08 pc 0028599f /system/lib/libart.so (art::JNI::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue*)+446)
    19468 19468 F DEBUG : #09 pc 00aca514 /data/app/com.curious.wordgenius-ETCWu9Rc16npzlRhWeH7jg==/lib/arm/libunity.so
    19468 19468 F DEBUG : #10 pc 0001481e <anonymous:e622e000>



     

    Attached Files:

  2. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    It's worth noting that there is a similar
    JNI ERROR
    crash related to Unity IAP 1.21.0 reported in this thread.

    However, that thread says the crash happens when the Unity IAP module is initialized.

    We are able to initialize the Unity IAP module without causing a crash.
     
  3. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    @JeffDUnity3D, you asked in this other thread, where people were complaining about problems with Android and Unity IAP 1.21.0, to open new threads.

    I'm having the same
    JNI ERROR
    that others are experiencing

    Please let me know if there is any other information you need to help debug.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @jreed-curious Yes, please provide exact steps to reproduce using a minimal project that demonstrates differing behavior in 1.21 vs earlier versions. Bug reports unfortunately are not sufficient, we need steps to reproduce.
     
  5. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    @JeffDUnity3D Sounds good. I'll put something together.

    Alternatively, would providing you our crashing APK along with reproduction steps be sufficient?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @jreed-curious If you could provide a minimal project that reproduces the issue, that would suffice. But not just the APK.
     
  7. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    @JeffDUnity3D Ok I'll put something together.

    In the meantime, could you clarify what exactly was added in the Unity IAP 1.21.0 upgrade? The release notes are not informative:
    Added
    UDP module, currently in closed beta. We will provide more information soon. This release did not modify any other IAP functionality.
    and Google isn't turning up any useful docs for "Unity UDP" (save for a couple mentions here and here).

    It would be a huge help to me in creating a minimally reproducing project to know what exactly the UDP module does and why it would have an impact on an android app using IAP.

    Thank you for your help!
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    jreed-curious likes this.
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @jreed-curious Actually we may have found the issue, and we could indeed test with your APK with the steps to reproduce. Please private message me the info, if possible.
     
    jreed-curious likes this.
  10. jreed-curious

    jreed-curious

    Joined:
    Jul 24, 2017
    Posts:
    10
    Awesome!

    My guess about the Sprites and memory pressure didn't pan out in my test-app. There are so many different moving parts in our app (plugins, coroutines, etc...) that its no small task to whittle it down to the bare essentials that cause the crash.

    I'll get you a copy in a few hours and steps to reproduce in a few hours.
     
  11. dhousky

    dhousky

    Joined:
    Mar 1, 2021
    Posts:
    5
    what was the result of this? I am seeing this in 2018.4.v32f1 still.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please open a new thread with steps to reproduce, you are likely seeing something different. Also ensure to be using IAP 3.0.1 and provide the device logs.