googleads-mobile-unity: App crashes on Admob integration in Unity 6.0 and Ads work on Unity editor but not on android device
[REQUIRED] Step 1: Describe your environment
- Unity version: Unity 6000.0.43f1
- Google Mobile Ads Unity plugin version: 10.0 (I also tried the older ones)
- Plugin installation method: Import (Unity package manager, .unitypackage import)
- Platform: Android (iOS, Android, Unity Editor)
- Platform OS version: Android target sdk 34 (eg iOS 10, Android 9)
- Any specific devices issue occurs on: All of the android devices
- Mediation ad networks used, and their versions: not using any
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur? This could be a description, log/console output, etc.
… the problem is after integrating admob in unity project and following your online documentation, ads work in unity editor but not in the mobile app and the android mobile crashes on opening after installing in a android device.
your documentation on gradle update to use latest admob plugin in older unity versions is outdated and missies steps and has the same issue. …
Please share a downloadable sample project that reproduces the bug, if available. This greatly helps us to diagnose and fix the issue faster.
Import it yourself and see it , my app got suspended on google playsotre because of your bug i have been stuck on it for more than a year
Relevant Code:
// TODO(you): code here to reproduce the problem
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (1 by maintainers)
Hello, we ran this with Unity 6 (6000.0.40f1) and we are able to reproduce this. This is not seen in 2023 and versions below so if its possible for you to use a different editor while we investigate further, please do so.
This should be addressed in the latest release. Please try with v10.1.0 and let us know if it works for you.
im using admob 10.0.0 i have crash issue in unity 6.0.32 Also Try in sample HelloWorld but same crash happen when click load native overlay works But after load when click on render ad its crash the game : 0001-01-01 00:00:00.000 -1 -1 Info --------- beginning of crash 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime FATAL EXCEPTION: main 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime Process: com.DefaultCompany.HelloWorld, PID: 15069 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime java.lang.NoSuchFieldError: No static field icon of type I in class Lcom/google/unity/ads/R$id; or its superclasses (declaration of ‘com.google.unity.ads.R$id’ appears in base.apk!classes3.dex) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at com.google.android.ads.nativetemplates.TemplateView.onFinishInflate(TemplateView.java:291) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.view.LayoutInflater.rInflate(LayoutInflater.java:1190) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1138) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.view.LayoutInflater.inflate(LayoutInflater.java:695) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.view.LayoutInflater.inflate(LayoutInflater.java:547) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.view.LayoutInflater.inflate(LayoutInflater.java:494) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at com.google.unity.ads.nativead.UnityNativeTemplateStyle.asTemplateView(UnityNativeTemplateStyle.java:58) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at com.google.unity.ads.nativead.UnityNativeTemplateAd$5.run(UnityNativeTemplateAd.java:264) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.os.Handler.handleCallback(Handler.java:938) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:99) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.os.Looper.loop(Looper.java:257) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:8192) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at java.lang.reflect.Method.invoke(Native Method) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626) 2025-04-07 09:26:33.643 15069 15069 Error AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Please update fast and solve this native overlay ads issue with unity 6
there is no error on pc
but on mobile the app crashes, no error pops up on mobile
On Fri, 4 Apr 2025 at 21:37, Nicholas Ventimiglia @.***> wrote:
What is the error you are seeing ?