FATAL EXCEPTION: main, having an error while starting app / Flutter - flutter

I am having some error while starting my android app down below. I think it has to do with AndroidManifest.xml Thank you for help in advance!
Debug console output:
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/AndroidRuntime(12850): FATAL EXCEPTION: main
E/AndroidRuntime(12850): Process: com.example.finalproject, PID: 12850
E/AndroidRuntime(12850): java.lang.RuntimeException: Unable to instantiate application io.flutter.app.FlutterApplication: java.lang.ClassNotFoundException: Didn't find class "io.flutter.app.FlutterApplication" on path: DexPathList[[zip file "/data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/lib/arm64, /data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
E/AndroidRuntime(12850): at android.app.LoadedApk.makeApplication(LoadedApk.java:1230)
E/AndroidRuntime(12850): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6575)
E/AndroidRuntime(12850): at android.app.ActivityThread.access$1400(ActivityThread.java:227)
E/AndroidRuntime(12850): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1890)
E/AndroidRuntime(12850): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(12850): at android.os.Looper.loop(Looper.java:224)
E/AndroidRuntime(12850): at android.app.ActivityThread.main(ActivityThread.java:7590)
E/AndroidRuntime(12850): at java.lang.reflect.Method.invoke(Native Method)
Didn't find class "io.flutter.app.FlutterApplication" on path: DexPathList[[zip file "/data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/lib/arm64, /data/app/com.example.finalproject-TKk2pSYMBdlivmhMJqry9A==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]

There seems to be an issue in the references that the Flutter project uses. You can run either flutter clean or flutter pub cache repair to help rebuild the references used in the project, then run flutter pub get to download the configured plugins.

Related

FFMPEG Kit issue in Banuba Video SDK : "FFmpegKit failed to start on brand"

I am trying to integrate Banuba Video Editor sdk in flutter.
The issue i am facing is as below
Banuba sdk works with native code for Android in Flutter
So Banuba requires FFMPEG dependency to define in Native Android
And I am already using 'ffmpeg_kit_flutter' plugin for flutter.
So both the FFMPEG kits are conflicted and some of the functions are not found. due to that I am receiving the below error.
When the app is launched I am receiving this Crash as mentioned
**java.lang.Error: FFmpegKit failed to start on brand: google, model: sdk_gphone_x86, device: generic_x86_arm, api level: 30, abis: x86 armeabi-v7a armeabi, 32bit abis: x86 armeabi-v7a armeabi, 64bit abis: .
** at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:50)
at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:189)
at com.arthenica.ffmpegkit.FFmpegKitConfig.<clinit>(FFmpegKitConfig.java:145)
at com.arthenica.ffmpegkit.FFmpegKitConfig.enableFFmpegSessionCompleteCallback(FFmpegKitConfig.java:864)
at com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin.registerGlobalCallbacks(FFmpegKitFlutterPlugin.java:168)
at com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin.init(FFmpegKitFlutterPlugin.java:652)
at com.arthenica.ffmpegkit.flutter.FFmpegKitFlutterPlugin.onAttachedToActivity(FFmpegKitFlutterPlugin.java:198)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.attachToActivityInternal(FlutterEngineConnectionRegistry.java:351)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.attachToActivity(FlutterEngineConnectionRegistry.java:324)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:194)
at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:498)
at com.sound.it.MainActivity.onCreate(MainActivity.kt:43)
at android.app.Activity.performCreate(Activity.java:8000)
at android.app.Activity.performCreate(Activity.java:7984)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
**Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "av_log_default_callback" referenced by "/data/app/~~umF3qlB9U53L4peU9nKYuQ==/com.sound.it-agqiFlNmMe17AHMK5gYIHw==/lib/x86/libffmpegkit.so"...**
at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:48)
Looking for the solutions

Flutter AdMob will not launch

Trying to incorporate adMob into a flutter app and I am having this issue:
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
lib/main.dart:1
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
E/AndroidRuntime(31743): FATAL EXCEPTION: pool-3-thread-1
E/AndroidRuntime(31743): Process: com.tendigitgrid.app_free, PID: 31743
E/AndroidRuntime(31743): java.lang.IllegalArgumentException: com.tendigitgrid.app_free: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime(31743): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E/AndroidRuntime(31743): at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/AndroidRuntime(31743): at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
E/AndroidRuntime(31743): at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
E/AndroidRuntime(31743): at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174)
E/AndroidRuntime(31743): at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108)
E/AndroidRuntime(31743): at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)
E/AndroidRuntime(31743): at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
E/AndroidRuntime(31743): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(31743): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(31743): at java.lang.Thread.run(Thread.java:920)
ANd it will not launch into the emulator to test.
I have minSDK set to 21 in my gradle file.
Update:
I tried installing the apk on my real phone and not in an emulator and it also did not work.

Flutter - Unable to Install Application to Emulator

I have a Flutter project that previously run on Flutter 2.2. Recently, I upgraded to Flutter 2.10 but unable to run the application on Android emulator. I've followed the instruction on https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects. I run the emulator on Ubuntu.
What I've tried (from other StackOverflow posts) didn't work at all:
Restarting emulator
Removing dependencies (I removed all dependencies in pubspec.yaml)
Accepting Android SDK licenses
Using Android Pie version emulator
Running flutter clean
Uninstall the app on the emulator
flutter doctor shows no problem.
Sometimes the run process stuck on Installing/built APK, sometimes I get 'Error connecting to the service protocol'. I also get the following error
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
E/AndroidRuntime(10386): FATAL EXCEPTION: main
E/AndroidRuntime(10386): Process: com.app.example, PID: 10386
E/AndroidRuntime(10386): java.lang.NoSuchMethodError: No static method getMainExecutor(Landroid/content/Context;)Ljava/util/concurrent/Executor; in class Landroidx/core/content/ContextCompat; or its super classes (declaration of 'androidx.core.content.ContextCompat' appears in /data/app/com.app.example-pnJtFUSDIe4xWUHIPO1jNQ==/base.apk)
E/AndroidRuntime(10386): at io.flutter.embedding.android.FlutterView.onAttachedToWindow(FlutterView.java:483)
E/AndroidRuntime(10386): at android.view.View.dispatchAttachedToWindow(View.java:18347)
E/AndroidRuntime(10386): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
E/AndroidRuntime(10386): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
E/AndroidRuntime(10386): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
E/AndroidRuntime(10386): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
E/AndroidRuntime(10386): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1761)
E/AndroidRuntime(10386): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
E/AndroidRuntime(10386): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
E/AndroidRuntime(10386): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
E/AndroidRuntime(10386): at android.view.Choreographer.doCallbacks(Choreographer.java:761)
E/AndroidRuntime(10386): at android.view.Choreographer.doFrame(Choreographer.java:696)
E/AndroidRuntime(10386): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
E/AndroidRuntime(10386): at android.os.Handler.handleCallback(Handler.java:873)
E/AndroidRuntime(10386): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(10386): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(10386): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(10386): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10386): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(10386): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I can run the same code (on the same project) to web browser. I can run the same code on the emulator if it's copied to another newly created project which is created with Flutter 2.10. I also have copied AndroidManifest.xml, build.gradle from the new project to the old one, but also not working.
Any solution or suggestion what should I do to fix it.
It looks like you still have references to previous versions of android libraries com.android... , latest flutter uses androidX.
Make sure you don't have any of
implementation 'com.android....`
in your gradle files.

Exception in thread "main" java.net.UnknownHostException: downloads.gradle-dn.com

I'm learning flutter for the first time using vscode and I'm getting this error where my app won't run. It happens when the app tries to run the Gradle task 'assembleDebug'. I don't know what Gradle is however, so I don't have a clue what's going on, any help on how to resolve this error would be greatly appreciated. This is the full error message:
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
lib\main.dart:1
Exception in thread "main" java.net.UnknownHostException: downloads.gradle-dn.com
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.base/java.net.Socket.connect(Socket.java:609)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:289)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect0(HttpURLConnection.java:2787)
at java.base/sun.net.www.protocol.http.HttpURLConnection.followRedirect(HttpURLConnection.java:2699)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1854)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I found a solution. The issue was with Gradle interacting with my installed Android Sdk, so using the Sdk manager in Android Studio, I uninstalled the current Sdk platform tools and then reinstalled them. This fixed the issue for me.

java.lang.NoSuchMethodError: com.vungle.warren.Vungle.updateConsentStatus after updating to latest Vungle SDK

I am using Vungle ad network via MoPub SDK for showing ads in Android Application. I have just updated the Vungle SDK to latest as per their changelog (version 6.3.12). Now the app is crashing. The exception is as below:
08-03 16:56:58.480 14071-14071/com.globaldelight.vizmato E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.globaldelight.vizmato, PID: 14071
java.lang.NoSuchMethodError: com.vungle.warren.Vungle.updateConsentStatus
at com.mopub.mobileads.VungleRouter$2.onSuccess(VungleRouter.java:85)
at com.vungle.warren.Vungle$2.onResponse(Vungle.java:479)
at com.vungle.warren.network.VungleApiClient$4.onResponse(VungleApiClient.java:514)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)
Could someone please help me solve this issue?
Thanks in advance.