Flutter AdMob will not launch - flutter

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.

Related

I get this error i get after upgrading flutter to the latest version

I get this error after upgrading flutter. please how can i fix it.
Launching lib\main.dart on Android SDK built for x86 in debug mode... Exception in thread "main" java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1607) at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1497) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1504) at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1308) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1271) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:733) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:850) at java.base/java.util.zip.ZipFile.(ZipFile.java:248) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.zip.ZipFile.(ZipFile.java:191) at org.gradle.wrapper.Install.unzip(Install.java:214) at org.gradle.wrapper.Install.access$600(Install.java:27) at org.gradle.wrapper.Install$1.call(Install.java:74) 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)
if you're using Windows, Go to the root directory C:\Users\YourUser and locate the hidden .gradle folder and delete it.
and then run your app connected to an Android emulator or device, don't cancel and make have a stable internet connection, this will download fresh Gradle
If the problem persists, Can you please provide your flutter doctor -v and flutter run --verbose logs, and a minimal complete reproducible code sample

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

I am getting an error while debugging the demo program on Flutter using both vs code and also android studio,

So, i've installed all the requirements for flutter doctor and its showing all green. but when i create a new project and debug it to check whether its working. its giving me this error on both vs code as well as android studio:
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
lib\main.dart:1
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.base/java.net.PlainSocketImpl.connect0(Native Method)
at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
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:299)
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:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:373)
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.getInputStream0(HttpURLConnection.java:1592)
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 tried running the demo flutter code and expect it to gave me an emulator showing the incrementing app

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.

Illegal byte sequence zipro W 10-02 23:01:47 10808 9104 Error opening archive T:\my_app\build\app\outputs\flutter-apk\app.apk: I/O error ERROR: dump

I have created this project before and I'm trying to run it again but I am getting the following error(s) :
Error Log:
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
lib\main.dart:1
√ Built build\app\outputs\flutter-apk\app-debug.apk.
ziparchive W 10-02 23:01:47 10808 9104 Unable to open 'T:my_ap\build\app\outputs\flutter-apk\app.apk': Illegal byte sequence
zipro W 10-02 23:01:47 10808 9104 Error opening archive T:\my_app\build\app\outputs\flutter-apk\app.apk: I/O error
ERROR: dump failed because resource AndroidManifest.xml not found
Failed to extract manifest from APK: ProcessException: The command failed
Command: C:\Users\cordt\AppData\Local\Android\sdk\build-tools\30.0.3\aapt dump xmltree T:\batí\Mail\projects\shop_app_3\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml.
Exception: Problem building Android application: see above error(s).
Exited (sigterm)
I have tried flutter clean but it didn't help me.
I came across a similar problem on an app I've been working on, the key takeaway is that this happened immediately after I update to the latest version of My flutter SDK. These are the steps I followed to solve this problem.
flutter create .
flutter clean
flutter pub get
flutter run