solid-software / flutter_vlc_player

📺 Flutter VLC powered video player.
521 stars 254 forks source link

App Crashes on Back #348

Closed sheikhhaziq closed 1 year ago

sheikhhaziq commented 2 years ago

hey!, I am using flutter_vlc_player in my app. when i go back from the page with flutter_vlc_player, the app crashes with this error.

Abort message: 'java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: JNI GetJavaVM called with pending exception java.lang.RuntimeException: Error during detachFromGLContext (see logcat for details)'
    x0  0000000000000000  x1  000000000000769b  x2  0000000000000006  x3  0000000000000008
    x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000080
    x8  0000000000000083  x9  00000078d0a35778  x10 fffffff87ffffbdf  x11 0000000000000001
    x12 0000000000000030  x13 00000078d0a7b1b0  x14 00000000ffffffff  x15 00002a7296276d54
    x16 00000078d0a6f2b8  x17 00000078d09ad368  x18 000000781e5ffd5a  x19 00000000000073c9
    x20 000000000000769b  x21 0000000000000083  x22 000000784d3edc60  x23 000000782edc3a80
    x24 0000000000000014  x25 000000781e600b79  x26 000000784d3edc60  x27 000000000000135a
    x28 000000781e602588  x29 000000781e600ae0
    sp  000000781e600aa0  lr  00000078d09a1b10  pc  00000078d09a1b3c
backtrace:
    #00 pc 0000000000021b3c  /system/lib64/libc.so (abort+124)
    #01 pc 000000000046ee08  /system/lib64/libart.so (art::Runtime::Abort(char const*)+1208)
    #02 pc 0000000000008d2c  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
    #03 pc 00000000004a1260  /system/lib64/libart.so (art::Thread::AssertNoPendingException() const+1144)
    #04 pc 000000000011d258  /system/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+64)
    #05 pc 00000000001382f4  /system/lib64/libart.so (art::ClassLinker::DoResolveType(art::dex::TypeIndex, art::Handle<art::mirror::DexCache>, art::Handle<art::mirror::ClassLoader>)+188)
    #06 pc 00000000004cbdb8  /system/lib64/libart.so (art::verifier::MethodVerifier::ScanTryCatchBlocks()+496)
    #07 pc 00000000004c8f64  /system/lib64/libart.so (art::verifier::MethodVerifier::Verify()+684)
    #08 pc 00000000004cb87c  /system/lib64/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc()+140)
    #09 pc 00000000004cb760  /system/lib64/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc(art::ArtMethod*, unsigned int, std::__1::vector<art::verifier::MethodVerifier::DexLockInfo, std::__1::allocator<art::verifier::MethodVerifier::DexLockInfo>>*, unsigned int)+536)
    #10 pc 00000000003c83ac  /system/lib64/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+828)
    #11 pc 00000000004aa9ac  /system/lib64/libart.so (art::MonitorObjectsStackVisitor::VisitFrame()+164)
    #12 pc 000000000048a4a0  /system/lib64/libart.so (_ZN3art12StackVisitor9WalkStackILNS0_16CountTransitionsE0EEEvb+1656)
    #13 pc 00000000004a0028  /system/lib64/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, bool) const+320)
    #14 pc 000000000049beb4  /system/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+436)
    #15 pc 00000000004b60ac  /system/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+996)
    #16 pc 00000000004af148  /system/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+1456)
    #17 pc 00000000004ae1c4  /system/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+1036)
    #18 pc 000000000046ead8  /system/lib64/libart.so (art::Runtime::Abort(char const*)+392)
    #19 pc 0000000000008d2c  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
    #20 pc 00000000002eb210  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1656)
    #21 pc 00000000002eb384  /system/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+108)
    #22 pc 00000000000fe1f8  /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+144)
    #23 pc 00000000000fcba8  /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::CheckPossibleHeapValue(art::ScopedObjectAccess&, char, art::(anonymous namespace)::JniValueType)+1144)
    #24 pc 00000000000fbf1c  /system/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)+628)
    #25 pc 00000000000f7028  /system/lib64/libart.so (art::(anonymous namespace)::CheckJNI::GetJavaVM(_JNIEnv*, _JavaVM**)+688)
    #26 pc 00000000004b9da8  /data/app/com.webyte.vidflix-1_oItvjtgvOWoQmodHi49Q==/lib/arm64/libvlc.so
    #27 pc 00000000000853c0  /system/lib64/libc.so (pthread_key_clean_all()+120)
    #28 pc 0000000000084e10  /system/lib64/libc.so (pthread_exit+72)
    #29 pc 0000000000084ce8  /system/lib64/libc.so (__pthread_start(void*)+40)
    #30 pc 000000000002344c  /system/lib64/libc.so (__start_thread+68)
Lost connection to device.
sheikhhaziq commented 2 years ago

I found out this error does not occur when you set hwAcc: HwAcc.disabled can anybody help me?

AzizHissi commented 2 years ago

I had same error when runinig the app on amazon firestick

neckaros commented 2 years ago

I had the same error and fixed it by stopping the video before going back and making sure everything is disposed. My guess is that VLC on the Java side is trying to push frames on a platform view that no longer exist

sheikhhaziq commented 2 years ago

I had the same error and fixed it by stopping the video before going back and making sure everything is disposed. My guess is that VLC on the Java side is trying to push frames on a platform view that no longer exist

In my case disposing video also crashes app

neckaros commented 2 years ago

I had the same error and fixed it by stopping the video before going back and making sure everything is disposed. My guess is that VLC on the Java side is trying to push frames on a platform view that no longer exist

In my case disposing video also crashes app

Do you await for stop before disposing?

WillPopScope(
      onWillPop: () async {
        if (_videoPlayerController != null) {
          await _videoPlayerController!.stop();
        }
        return true;
      },