Coder Social home page Coder Social logo

NPE Attempt to invoke virtual method 'com.facebook.ads.internal.view.d.c.d com.facebook.ads.internal.view.j.getState()' about audience-network HOT 9 CLOSED

fbsamples avatar fbsamples commented on August 22, 2024
NPE Attempt to invoke virtual method 'com.facebook.ads.internal.view.d.c.d com.facebook.ads.internal.view.j.getState()'

from audience-network.

Comments (9)

gregko avatar gregko commented on August 22, 2024 1

Had the same problem on Android 5.1 (maybe others too, did not test). Per @reiterp-avs comment above, I removed:

android:visibility="gone"

from the XML layout of the native ad, and I set the visibility as needed in Java code instead. This fixed the problem.

from audience-network.

phzhou avatar phzhou commented on August 22, 2024

Hi @Baobomb can you let us know more details about your problem?
Which SDK version are you using?
What is your inflate process?
If you can provide code snippets that you were able to reproduce the problem that would be great help!
Thanks

from audience-network.

MarcusCwl avatar MarcusCwl commented on August 22, 2024

SDK version : 4.25.0
It happend when try to inflate layout which include
MediaView.

from audience-network.

vmalykhin avatar vmalykhin commented on August 22, 2024

Happening on Android 4.x and 5.x devices using audience-network-sdk:4.26.0. Not reproduced on v.4.23.0, looks like the issue was introduced in v.4.24.0.

from audience-network.

 avatar commented on August 22, 2024

@Baobomb Do you set the MediaView visibility attribute in your layout? In case you do, maybe you can avoid the NPE by not setting it and set it at runtime, after the view is inflated.

from audience-network.

phzhou avatar phzhou commented on August 22, 2024

Hi @Baobomb @vmalykhin unfortunately we weren't able to reproduce the problem. Would you mind provide a sample project so we can try to reproduce the problem? Thanks!

from audience-network.

 avatar commented on August 22, 2024

Hi, I have already reported the bug here https://developers.facebook.com/bugs/2003665309903654/ and the bug report includes sample.

from audience-network.

Sarun1001 avatar Sarun1001 commented on August 22, 2024

@phzhou @reiterp-avs Hi guys I'm also facing the same issue, app crashes while using SDK version above v.4.23.0.

The issue is currently experiencing on xiaomi devices that running on MiUi.
Other tested devices are working normally

android.view.InflateException: Binary XML file line #59: Binary XML file line #59: Error inflating class com.facebook.ads.MediaView
Caused by: android.view.InflateException: Binary XML file line #59: Error inflating class com.facebook.ads.MediaView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:652)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:812)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.inflate(LayoutInflater.java:522)
at android.view.LayoutInflater.inflate(LayoutInflater.java:430)
at me.timos.thuanle.fbnativeadadapter.FBNativeAdAdapterBig.onCreateAdViewHolder(FBNativeAdAdapterBig.java:141)
at me.timos.thuanle.fbnativeadadapter.FBNativeAdAdapterBig.onCreateViewHolder(FBNativeAdAdapterBig.java:149)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6519)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5706)
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:285)
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:342)
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:358)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:365)
at android.support.v7.widget.GapWorker.run(GapWorker.java:396)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6326)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.UnsupportedOperationException: TextureView doesn't support displaying a background drawable
at android.view.TextureView.setBackgroundDrawable(TextureView.java:302)
at android.view.View.setBackground(View.java:18149)
at android.view.View.(View.java:4582)
at android.view.View.(View.java:4089)
at android.view.View.(View.java:4068)
at android.view.TextureView.(TextureView.java:146)
at com.facebook.ads.internal.view.d.c.b.(Unknown Source)
at com.facebook.ads.internal.view.o.(Unknown Source)
at com.facebook.ads.internal.view.j.(Unknown Source)
at com.facebook.ads.MediaViewVideoRenderer.(Unknown Source)
at com.facebook.ads.internal.view.h.(Unknown Source)
at com.facebook.ads.MediaView.(Unknown Source)
at java.lang.reflect.Constructor.newInstance0(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
at android.view.LayoutInflater.createView(LayoutInflater.java:652) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:812) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:522) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:430) 
at me.timos.thuanle.fbnativeadadapter.FBNativeAdAdapterBig.onCreateAdViewHolder(FBNativeAdAdapterBig.java:141) 
at me.timos.thuanle.fbnativeadadapter.FBNativeAdAdapterBig.onCreateViewHolder(FBNativeAdAdapterBig.java:149) 
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6519) 
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5706) 
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:285) 
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:342) 
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:358) 
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:365) 
at android.support.v7.widget.GapWorker.run(GapWorker.java:396) 
at android.os.Handler.handleCallback(Handler.java:754) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6326) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770) 

from audience-network.

phzhou avatar phzhou commented on August 22, 2024

Hi @Baobomb @vmalykhin @reiterp-avs @Sarun1001 have you guys tried the latest SDK and see if it fixes your issue?
Also how are you guys using the SDK? Are you including it from the gradle build dependency, or include the SDK as aar file in the project libs folder?

from audience-network.

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.