I created two app in one project in flutter the first one it works very well , but the second one
when I run my flutter app it has been installed in the device but it does work when i try to open the close app message appear like something wrong on it but this wrong happened when i run it android device when i run it web browser it is worded
this the message error in visual studio code after the app closed.
E/AndroidRuntime(16520): FATAL EXCEPTION: main E/AndroidRuntime(16520): Process: com.android.systemui, PID: 16520 E/AndroidRuntime(16520): java.lang.IllegalStateException: Already in the pool! E/AndroidRuntime(16520): at android.util.Pools$SimplePool.release(Pools.java:112) E/AndroidRuntime(16520): at android.util.Pools$SynchronizedPool.release(Pools.java:168) E/AndroidRuntime(16520): at com.android.internal.widget.MessagingTextMessage.recycle(MessagingTextMessage.java:95) E/AndroidRuntime(16520): at com.android.internal.widget.MessagingGroup.updateMessageColor(MessagingGroup.java:389) E/AndroidRuntime(16520): at com.android.internal.widget.MessagingGroup.setTextColors(MessagingGroup.java:366) E/AndroidRuntime(16520): at com.android.systemui.statusbar.NotificationColorPicker.updateMessaging(NotificationColorPicker.java:804) E/AndroidRuntime(16520): at com.android.systemui.statusbar.NotificationColorPicker.updateBase(NotificationColorPicker.java:814) E/AndroidRuntime(16520): at com.android.systemui.statusbar.NotificationColorPicker.updateBig(NotificationColorPicker.java:786) E/AndroidRuntime(16520): at com.android.systemui.statusbar.NotificationColorPicker.init(NotificationColorPicker.java:501) E/AndroidRuntime(16520): at com.android.systemui.statusbar.notification.NotificationInflater$8.onViewApplied(NotificationInflater.java:460) E/AndroidRuntime(16520): at android.widget.RemoteViews$AsyncApplyTask.onPostExecute(RemoteViews.java:3741) E/AndroidRuntime(16520): at android.widget.RemoteViews$AsyncApplyTask.onPostExecute(RemoteViews.java:3670) E/AndroidRuntime(16520): at android.os.AsyncTask.finish(AsyncTask.java:695) E/AndroidRuntime(16520): at android.os.AsyncTask.access$600(AsyncTask.java:180) E/AndroidRuntime(16520): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712) E/AndroidRuntime(16520): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(16520): at android.os.Looper.loop(Looper.java:214) E/AndroidRuntime(16520): at android.app.ActivityThread.main(ActivityThread.java:7045) E/AndroidRuntime(16520): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(16520): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/AndroidRuntime(16520): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) Installing buildappoutputsflutter-apkapp-debug.apk... 45.8s E/AndroidRuntime(17077): FATAL EXCEPTION: main E/AndroidRuntime(17077): Process: com.amal.sellerapp, PID: 17077 E/AndroidRuntime(17077): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.amal.sellerapp/com.amal.sellerapp.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.amal.sellerapp.MainActivity" on path: DexPathList[[zip file "/data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/base.apk"],nativeLibraryDirectories=[/data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/lib/arm64, /data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] E/AndroidRuntime(17077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3020) E/AndroidRuntime(17077): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3251) E/AndroidRuntime(17077): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) E/AndroidRuntime(17077): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) E/AndroidRuntime(17077): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) E/AndroidRuntime(17077): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948) E/AndroidRuntime(17077): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(17077): at android.os.Looper.loop(Looper.java:214) E/AndroidRuntime(17077): at android.app.ActivityThread.main(ActivityThread.java:7045) E/AndroidRuntime(17077): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(17077): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/AndroidRuntime(17077): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) E/AndroidRuntime(17077): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.amal.sellerapp.MainActivity" on path: DexPathList[[zip file "/data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/base.apk"],nativeLibraryDirectories=[/data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/lib/arm64, /data/app/com.amal.sellerapp-oRx_OCSSpKxfezBX_bPwxw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] E/AndroidRuntime(17077): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) E/AndroidRuntime(17077): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/AndroidRuntime(17077): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/AndroidRuntime(17077): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69) E/AndroidRuntime(17077): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) E/AndroidRuntime(17077): at android.app.Instrumentation.newActivity(Instrumentation.java:1215) E/AndroidRuntime(17077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3008) E/AndroidRuntime(17077): ... 11 more
- I tried flutter clean and flutter pub get .
- I tired to reinstall google services
- I tried change the device
- I checked of " com.amal.sellerapp" in AndroidManifest.xml every is good and clear
nothing fix my app
2
Answers
'Already in the pool!'
Error (Android):The error message
java.lang.IllegalStateException: Already in the pool!
suggests a problem with Android’s system UI, specifically related to handling notifications. This error might not be directly caused by your Flutter app but could be triggered due to certain interactions.To troubleshoot this issue, consider the following steps:
Check your Flutter app’s code for any unusual or incorrect notification handling.
Ensure that your Flutter and Dart versions are up to date, and your project dependencies are correctly configured.
Update your Flutter SDK to the latest version to see if the issue is resolved.
If the problem persists, please provide more details about your Flutter app’s code and configuration for further assistance.
'ClassNotFoundException'
Error (Android):The error message
java.lang.ClassNotFoundException: Didn't find class "com.amal.sellerapp.MainActivity"
indicates that the Android system couldn’t find your Flutter app’s main activity class when trying to launch it.To resolve this issue, follow these steps:
Double-check your
AndroidManifest.xml
file to ensure that the element specifies the correct package and class name for your main activity. It should match the actual package and class name of your Flutter app’s main activity.Verify that there are no typos or errors in the package and class names in your
AndroidManifest.xml
file.Rebuild your Flutter project by running flutter clean followed by flutter build to ensure that all necessary files and classes are generated correctly.
Make sure your Flutter app’s code and project structure are correct. The MainActivity class should be defined in your Flutter project and should extend
io.flutter.embedding.android.FlutterActivity.
Please try to add the following code snippet.
My app worked well with this code.