Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash in release mode but work properly in debug mode (Flutter) #6624

Open
muntasir-ifaz574 opened this issue Jan 14, 2025 · 2 comments
Open

Comments

@muntasir-ifaz574
Copy link

E/AndroidRuntime(18069): FATAL EXCEPTION: main
E/AndroidRuntime(18069): Process: com.garibook.partner, PID: 18069
E/AndroidRuntime(18069): java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (21.0.0). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
E/AndroidRuntime(18069): at m9.o$a$a.run(Unknown Source:6)
E/AndroidRuntime(18069): at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(18069): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(18069): at android.os.Looper.loopOnce(Looper.java:257)
E/AndroidRuntime(18069): at android.os.Looper.loop(Looper.java:368)
E/AndroidRuntime(18069): at android.app.ActivityThread.main(ActivityThread.java:8839)
E/AndroidRuntime(18069): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18069): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
E/AndroidRuntime(18069): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
E/AndroidRuntime(18069): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: No virtual method object()Lbi/e; in class Lbi/e; or its super classes (declaration of 'bi.e' appears in /data/app/~~AgtClw9jrsEiRqNSTr1ZBQ==/com.garibook.partner-iqvpPgDx31wPlMSiYjinuw==/base.apk!classes2.dex)
E/AndroidRuntime(18069): at s9.b.m(Unknown Source:30)
E/AndroidRuntime(18069): at q9.y.u(Unknown Source:7)
E/AndroidRuntime(18069): at q9.y.t(Unknown Source:1)
E/AndroidRuntime(18069): at q9.n.E(Unknown Source:27)
E/AndroidRuntime(18069): at com.google.firebase.database.h$b.run(Unknown Source:6)
E/AndroidRuntime(18069): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
E/AndroidRuntime(18069): at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/AndroidRuntime(18069): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/AndroidRuntime(18069): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime(18069): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime(18069): at java.lang.Thread.run(Thread.java:1012)
E/AndroidRuntime(18069): Caused by: java.lang.NoSuchMethodError: No virtual method object()Lbi/e; in class Lbi/e; or its super classes (declaration of 'bi.e' appears in /data/app/~~AgtClw9jrsEiRqNSTr1ZBQ==/com.garibook.partner-iqvpPgDx31wPlMSiYjinuw==/base.apk!classes2.dex)
E/AndroidRuntime(18069): at aa.b.e(Unknown Source:4)
E/AndroidRuntime(18069): at aa.b.d(Unknown Source:59)
E/AndroidRuntime(18069): at aa.b.c(Unknown Source:0)
E/AndroidRuntime(18069): at v9.h.y(Unknown Source:8)
E/AndroidRuntime(18069): at m9.p.o(Unknown Source:44)
E/AndroidRuntime(18069): at s9.i.s(Unknown Source:5)
E/AndroidRuntime(18069): at s9.i.v(Unknown Source:45)
E/AndroidRuntime(18069): at s9.i.u(Unknown Source:1)
E/AndroidRuntime(18069): at s9.b.h(Unknown Source:2)
E/AndroidRuntime(18069): at q9.y$c.a(Unknown Source:148)
E/AndroidRuntime(18069): at q9.y$c.call(Unknown Source:0)
E/AndroidRuntime(18069): at s9.b.m(Unknown Source:5)
E/AndroidRuntime(18069): ... 10 more

I am getting this when i run the app in release mode my app crash. but when i am in debug mode app work properly. below i give my sample code

StreamBuilder(
stream: FirebaseDatabase.instance.ref('driver_chats').child(controller.userCode).child('messages').orderByChild('timeStamp')
// .limitToLast(100)
.onValue,
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
if (snapshot.data!.snapshot.value != null) {
Map<dynamic, dynamic> map =
snapshot.data!.snapshot.value as dynamic;
List list = [];
List reversedList = [];
list.clear();
reversedList.clear();
list = map.values.toList();
list.sort(
(a, b) => a['timeStamp'].compareTo(b['timeStamp']));
reversedList = list.reversed.toList();
return Stack(
children: [
Center(
child: Opacity(
opacity: 0.1,
child: Lottie.asset(
'assets/images/lottie/Messages.json',
),
)),
ListView.separated(
itemCount: snapshot.data!.snapshot.children.length,
reverse: true,
itemBuilder: (BuildContext context, int index) {
// downloadProgress.length = snapshot.data.docs.length;

                        String timeStampStr =
                            reversedList[index]['timeStamp'].toString();
                        DateTime dateTime = DateTime.parse(timeStampStr);
                        DateTime utcPlus6 =
                            dateTime.toUtc().add(const Duration(hours: 6));
                        String formattedTime = utcPlus6.toString();

                        return Align(
                          alignment: reversedList[index]['sentBy'] == 'user'
                              ? Alignment.centerRight
                              : Alignment.centerLeft,
                          child: _chatItems(
                              message: reversedList[index]['message'],
                              isFrom: reversedList[index]['sentBy'],
                              isSeen: reversedList[index]['isSeen'],
                              timeStamp: formattedTime,
                              file: reversedList[index]['file'],
                              audioPath: reversedList[index]
                                  ['voice_messages'],
                              filename: reversedList[index]['file_name'],
                              size: size,
                              index: index,
                              imageFile: reversedList[index]['photo']),
                        );
                      },
                      separatorBuilder: (BuildContext context, int index) {
                        return Container();
                      },
                    ),
                  ],
                );
                // return Container();
              } else {
                return Center(
                    child: Lottie.asset(
                  'assets/images/lottie/Messages.json',
                ));
              }
            }

            return const Center(
                child: CircularProgressIndicator(
              color: ColorManager.primaryColor,
            ));
          },
        ),
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@lehcar09
Copy link
Contributor

Hi @muntasir-ifaz574, thank you for reaching out. I tried reproducing the issue based on the code snippet you shared, with minor modification in the query, however, I did not encounter the exception when I ran the app in release mode.

I'm thinking, if it’s possible that this could be caused by configuration. Can you share an MCVE to help us investigate this issue? You can use this sample app and make incremental changes to reproduce the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants