Closed parmeetmaster closed 1 year ago
Hi @parmeetmaster, please provide a completed and minimal reproducible code sample so that we may verify this. In this case, it also contains Android native configuration, please create a Github repository for this and make it public so that we can access it.
Also, you can try running google_mobile_ads/example in release mode to check if the issue can reproduce.
Thank you!
Hello @huycozy
Please refer my repository complete.I need this error to fix so i can reveal my whole work.Just run app via flutter run --release
Hi @parmeetmaster Thanks for providing the repository but it's a complex production code. For the issue to be workable, it needs to be reproducible with a completed and minimal reproducible code sample that doesn’t include 3rd party plugins or complex production code.
Also, you can try running google_mobile_ads/example in release mode to check if the issue can reproduce.
Thank you!
Please use 3 steps: Just clone the repository. ==> https://github.com/parmeetmaster/animekillnewapp.git
Run this command :
1) flutter pub get
2) flutter pub run build_runner watch --delete-conflicting-outputs
3) flutter run --release
Hi @parmeetmaster
The goal of this Github repo is not to give assistance on personal code or the whole package/plugin project,
but to improve googleads-mobile-flutter
plugin reporting bugs or feature requests.
In this case, you provide a complex production code where the issue can be caused by your own implementation or other components inside project. So, please provide a completed and minimal reproducible code sample that represents the problem.
Instead, if you think that the issue might depend on your implementation, please see flutter's community for resources and ask questions like this. You may also get some help if you post it on Stack Overflow and flutterhelp.
Thank you!
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
Plugin version is google_mobile_ads: ^2.1.0
I configure Gradle in such a way
Gradle
```gradle def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' // START: FlutterFire Configuration apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' // END: FlutterFire Configuration apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 33 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.anime.animekill" minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // signingConfig signingConfigs.debug signingConfig signingConfigs.release } } buildFeatures { viewBinding true } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.github.MonsterTechnoGits:WebViewAdblock:1.1' implementation 'androidx.appcompat:appcompat:1.5.0' implementation 'com.android.support:multidex:1.0.3' implementation 'com.google.android.gms:play-services-ads:21.3.0' implementation 'com.google.ads.mediation:facebook:6.11.0.1' //implementation 'com.github.gundy:semver4j:0.16.4' } ```AdHelper class such way:
dart
```dart import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'dart:math'; class AdHelper { var _interstitialAd; BannerAd? banner1 = null; BannerAd? banner2 = null; BannerAd? homeBanner = null; bool reduceAds = false; /* final NativeAdListener navtiveAdListener = NativeAdListener( // Called when an ad is successfully received. onAdLoaded: (Ad ad) => print('Ad loaded.'), // Called when an ad request failed. onAdFailedToLoad: (Ad ad, LoadAdError error) { // Dispose the ad here to free resources. ad.dispose(); print('Ad failed to load: $error'); }, // Called when an ad opens an overlay that covers the screen. onAdOpened: (Ad ad) => print('Ad opened.'), // Called when an ad removes an overlay that covers the screen. onAdClosed: (Ad ad) => print('Ad closed.'), // Called when an impression occurs on the ad. onAdImpression: (Ad ad) => print('Ad impression.'), // Called when a click is recorded for a NativeAd. onAdClicked: (Ad ad) => print('Ad clicked.'), ); */ Future