fbsamples / audience-network

Open source projects to demonstrate SDK and sample code usages and integration, and to collaborate and support peers in this community.
https://developers.facebook.com/docs/audience-network
Other
318 stars 371 forks source link

Exception on native ad sample fro android #164

Closed wishygupta closed 2 years ago

wishygupta commented 2 years ago

Seeing this issue on Android Kotlin sample for native ad

2022-06-02 12:06:17.530 11853-11853/com.facebook.samples.AdUnitsSample E/ViewConfiguration: Tried to access UI constants from a non-visual Context:com.facebook.ads.redexgen.X.Xy@a7e998UI constants, such as display metrics or window metrics, must be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen java.lang.IllegalArgumentException: Tried to access UI constants from a non-visual Context:com.facebook.ads.redexgen.X.Xy@a7e998 at android.view.ViewConfiguration.get(ViewConfiguration.java:510) at android.view.View.<init>(View.java:5380) at android.view.View.<init>(View.java:5541) at android.view.ViewGroup.<init>(ViewGroup.java:698) at android.widget.RelativeLayout.<init>(RelativeLayout.java:255) at android.widget.RelativeLayout.<init>(RelativeLayout.java:251) at com.facebook.ads.redexgen.X.NQ.<init>(:45919) at com.facebook.ads.redexgen.X.7e.<init>(:17640) at com.facebook.ads.redexgen.X.7e.<init>(:17638) at com.facebook.ads.redexgen.X.7e.<init>(:17636) at com.facebook.ads.redexgen.X.UN.initialize(:56309) at com.facebook.ads.DefaultMediaViewVideoRenderer.initializeSelf(DefaultMediaViewVideoRenderer.java:47) at com.facebook.ads.DefaultMediaViewVideoRenderer.<init>(DefaultMediaViewVideoRenderer.java:29) at com.facebook.ads.redexgen.X.bd.A0E(:69864) at com.facebook.ads.redexgen.X.bd.initialize(:70120) at com.facebook.ads.MediaView.initializeSelf(MediaView.java:69) at com.facebook.ads.MediaView.<init>(MediaView.java:48) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:852) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1261) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1117) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1124) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082) at android.view.LayoutInflater.inflate(LayoutInflater.java:680) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at com.facebook.samples.adunitssamplekotlin.fragments.NativeAdSampleFragment.onCreateView(NativeAdSampleFragment.kt:62) at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2439) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:802) at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625) at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411) at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366) at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273) at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273) at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229) at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:201) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:620) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:178)

github-actions[bot] commented 2 years ago

Dear developers. You will not be able to create new bug reports on GitHub after 28 April, and existing tickets will be automatically closed.

Instead, please use the bug report (https://developers.facebook.com/support/bugs/) tool to report a bug on Audience Network. Our engineers will get back to you as soon as possible.

If you have any other questions or suggestions relating to Facebook Audience Network, please use the online publisher support portal (https://www.facebook.com/business/publishersupport?hc_location=ufi) to submit a request.