GithubHelp home page GithubHelp logo

Comments (18)

DevKathirva avatar DevKathirva commented on July 17, 2024 1

Having the same problem. Only native ad is not working, banner ad is working fine.

Native ad works fine in newly created project. But could not make it work in my existing project.
I have migrated my existing project to embeeding v2. Everything working fine except native ad.

Below is the log when native ad request is sent:

I/Ads ( 6920): This request is sent from a test device. I/DynamiteModule( 6920): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400 I/DynamiteModule( 6920): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400 V/DynamiteModule( 6920): Dynamite loader version >= 2, using loadModule2NoCrashUtils I/DynamiteModule( 6920): Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:21400 I/DynamiteModule( 6920): Selected remote version of com.google.android.gms.ads.dynamite, version >= 21400 V/DynamiteModule( 6920): Dynamite loader version >= 2, using loadModule2NoCrashUtils D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 I/art ( 6920): Background sticky concurrent mark sweep GC freed 84343(5MB) AllocSpace objects, 44(1804KB) LOS objects, 32% free, 17MB/25MB, paused 3.295ms total 139.764ms D/EgretLoader( 6920): EgretLoader(Context context) D/EgretLoader( 6920): The context is not activity I/Ads ( 6920): This request is sent from a test device. D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 I/Ads ( 6920): This request is sent from a test device. D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 D/AudioManager( 6920): getStreamVolume isRestricted mode = 0 W/art ( 6920): Long monitor contention event with owner method=int libcore.io.Posix.readBytes(java.io.FileDescriptor, java.lang.Object, int, int) from Posix.java:4294967294 waiters=0 for 763ms W/art ( 6920): Long monitor contention event with owner method=int libcore.io.Posix.readBytes(java.io.FileDescriptor, java.lang.Object, int, int) from Posix.java:4294967294 waiters=1 for 718ms W/Ads ( 6920): Not retrying to fetch app settings W/Ads ( 6920): Not retrying to fetch app settings D/EgretLoader( 6920): EgretLoader(Context context) D/EgretLoader( 6920): The context is not activity D/EgretLoader( 6920): EgretLoader(Context context) D/EgretLoader( 6920): The context is not activity I/art ( 6920): Background sticky concurrent mark sweep GC freed 45783(2MB) AllocSpace objects, 58(3MB) LOS objects, 24% free, 18MB/25MB, paused 7.460ms total 81.212ms D/EgretLoader( 6920): EgretLoader(Context context) D/EgretLoader( 6920): The context is not activity I/art ( 6920): Background sticky concurrent mark sweep GC freed 31956(1016KB) AllocSpace objects, 36(3MB) LOS objects, 8% free, 23MB/25MB, paused 5.663ms total 73.795ms I/art ( 6920): Background sticky concurrent mark sweep GC freed 29593(903KB) AllocSpace objects, 14(1276KB) LOS objects, 6% free, 23MB/25MB, paused 6.020ms total 34.344ms I/art ( 6920): Background sticky concurrent mark sweep GC freed 2322(233KB) AllocSpace objects, 11(1112KB) LOS objects, 0% free, 25MB/25MB, paused 7.908ms total 55.234ms

Check below the screenshot of output:
WhatsApp Image 2021-02-21 at 10 17 33 PM

from native_admob_flutter.

DevKathirva avatar DevKathirva commented on July 17, 2024 1

Looks like problem is with using other dependencies(Native Admob) with this widget, in my case I was using 'flutter_native_admob' widget. I removed it and now native ad works fine with my existing project.

from native_admob_flutter.

DevKathirva avatar DevKathirva commented on July 17, 2024 1

Still this problem exist when we add other native AdMob dependency.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024 1

unfortunately I only get errors loading it.

Same as #11 (comment) . Run flutter clean and try again

Still this problem exist when we add other native AdMob dependency.

I'll make sure to mention it in the documentation. Seems like there's nothing I can do about it

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

That's probably because you didn't set a fontSize in TextStyle nor a size to the image.

Will be fixed in the next version.

As shown in the example, you need to set the attributes of the views in the NativeAd constructor

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

I just released a new version with the fix for it: v0.8.0. Open a new issue with more details if you still see the error with that version

from native_admob_flutter.

oliverbytes avatar oliverbytes commented on July 17, 2024

Hi bdlukaa, thanks for the response. However even with the most recent update, still no texts and image appear. I've pasted your example code below

NativeAd(
            height: 60,
            builder: (context, child) {
              return Material(
                elevation: 8,
                child: child,
              );
            },
            buildLayout: adBannerLayoutBuilder,
            loading: Text('loading'),
            error: Text('error'),
            icon: AdImageView(padding: EdgeInsets.only(left: 6)),
            headline: AdTextView(style: TextStyle(color: Colors.black)),
            advertiser: AdTextView(style: TextStyle(color: Colors.black)),
            body: AdTextView(style: TextStyle(color: Colors.black)),
            media: AdMediaView(height: 70, width: 120),
            button: AdButtonView(
              margin: EdgeInsets.only(left: 6, right: 6),
              textStyle: TextStyle(color: Colors.green, fontSize: 14),
            ),
          )

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

I need more information to be able to help. It works just fine on mine and others' devices.
You can join my discord server so we can talk better: https://discord.gg/674gpDQUVq

However, I'll be reopening this issue

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

@DevKathirva
Since you said it works fine on a newly created project but not on your existent, could you try deleting the android folder, creating it again (flutter create .) and do the setup again?

NOTE: Keep in mind the files you're deleting and what you're doing

from native_admob_flutter.

DevKathirva avatar DevKathirva commented on July 17, 2024

Hi, I tried it.

I removed android folder and created it again using flutter create . I had to do lot of configuration again(firebase, androidx, update gradle version and others) in android to build again. Built it successfully but still native ad not working.

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

Native ad works fine in newly created project. But could not make it work in my existing project.

Maybe you could create a new project and move all the dart files to it. I know this is not the best solution but maybe it works

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

I just published a new version (v0.9.2) that is supposed to fix this issue. Can you try it?

from native_admob_flutter.

oliverbytes avatar oliverbytes commented on July 17, 2024

I just published a new version (v0.9.2) that is supposed to fix this issue. Can you try it?

I tried the latest version and using your native ads screen. unfortunately I only get errors loading it.

from native_admob_flutter.

DevKathirva avatar DevKathirva commented on July 17, 2024

@nemoryoliver Hi. Have you tried by removing any other dependency related to AdMob from pubspec.yaml?

from native_admob_flutter.

oliverbytes avatar oliverbytes commented on July 17, 2024

@nemoryoliver Hi. Have you tried by removing any other dependency related to AdMob from pubspec.yaml?

yes I did try removing all but native_admob_flutter. But when creating a new project everything works as expected.

from native_admob_flutter.

oliverbytes avatar oliverbytes commented on July 17, 2024

unfortunately I only get errors loading it.

Same as #11 (comment) . Run flutter clean and try again

Still this problem exist when we add other native AdMob dependency.

I'll make sure to mention it in the documentation. Seems like there's nothing I can do about it

I've tried flutter clean as well but still get error loading Native Ads

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

But when creating a new project everything works as expected.

I'll mention in the documentation it's recommended to create the project on flutter version 1.22 or later (See #flutter). It seems it's an error with the prebuilt android project.

Can this issue be closed now?

from native_admob_flutter.

bdlukaa avatar bdlukaa commented on July 17, 2024

I just published a new version that is supposed to fix this issue: v0.9.4

I'll be closing this issue. If the problem is not solved, please re-open this issue with more details.

from native_admob_flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.