Skip to content

[Android] HelloWorld Sample encountered ArgumentNullException while initializing MobileAds #3951

@lhwynew

Description

@lhwynew

[REQUIRED] Step 1: Describe your environment

  • Unity version: Unity 2022.3.51f1c1
  • Google Mobile Ads Unity plugin version: 10.4.2
  • Plugin installation method: Unity package manager
  • Platform: Android
  • Platform OS version: Android 11 and 13
  • 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:

The problem is after integrating admob in unity project and following your online documentation, ads worked fine in Unity editor, but when I ran it on mobile phone, it can't be initialized, an ArgumentNullException occurred while MobileAds.Initialize().

Then I tried your sample Hello World, it worked just fine in Unity editor, but same exception occurred while ran on mobile phone.

Strange thing is when I switched it to mono, it worked fine on mobile phone, but il2cpp just got this exception error.

I have tried reinstall the plugin, also tried debug version, also tried .net framework and .net 2.1, but still the same problem, it seems that the code of Google mobile ads has been striped

Image

I didn't change any code of the sample Hello World, just ran it on mobile phone(I have tried arm32 and arm64 phone), but it just got the same problem. Please help!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions