Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admob-plus-cordova-native - cannot find viewProvider: #662

Open
vandilsondamata opened this issue Apr 11, 2024 · 10 comments
Open

admob-plus-cordova-native - cannot find viewProvider: #662

vandilsondamata opened this issue Apr 11, 2024 · 10 comments

Comments

@vandilsondamata
Copy link

Describe the bug
I'm facing this error "cannot find viewProvider: " when trying to display native ads.
admob-plus-cordova-native it's installed.

Expected behavior
The ad display

Screenshots
Print

Environment

AdMob Plus Environment Info:
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
Memory: 5.01 GB / 15.89 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-222.4459.24.2221.10121639
Languages:
Java: 11.0.17
npmPackages:
admob-plus-cordova: 2.0.0-alpha.16 => 2.0.0-alpha.16
admob-plus-cordova-native: ^1.0.0-alpha.17 => 1.0.0-alpha.17
cordova-android: ^12.0.1 => 12.0.1
cordova-browser: 6.0.0 => 6.0.0
cordova-ios: 6.2.0 => 6.2.0
Cordova:
Version: 12.0.0 (cordova-lib@12.0.1)
Plugins:
admob-plus-cordova: 2.0.0-alpha.16
admob-plus-cordova-native: ^1.0.0-alpha.17
Ionic:
Version: -
AndroidManifest.xml:
Version: -

Additional context

showNativeAd() {
const ad = new admob.NativeAd({
adUnitId: 'ca-app-pub-3940256099942544/3986624511',
})

return ad
  .load()
  .then(() =>
    ad.show({
      x: 0,
      y: 30,
      width: window.screen.width,
      height: 300,
    }),
  )
  .then(
    () =>
      new Promise((resolve) =>
        setTimeout(() => {
          ad.hide()
          resolve()
        }, 5000),
      ),
  )
  .then(() => ad.showWith(document.getElementById('native-ad')))

}

@ratson
Copy link
Member

ratson commented Apr 12, 2024

@vandilsondamata Let me know if the latest version fix this.

@vandilsondamata
Copy link
Author

I just tested, the problem persists.
admob-plus-cordova-native@1.0.0-alpha.18

@ratson
Copy link
Member

ratson commented Apr 12, 2024

@vandilsondamata Would you check npx admob-plus doctor and provide npx admob-plus info?

@vandilsondamata
Copy link
Author

npx admob-plus doctor

√ googleads.g.doubleclick.net
‼ package.json
× cordova.plugins.admob-plus-cordova.APP_ID_ANDROID
› Test ID is used: ca-app-pub-3940256099942544~3347511713
√ Cordova Android dependencies
√ config.xml
↓ platforms/ios/*.xcodeproj
√ plugins/admob-plus-cordova/package.json

npx admob-plus info

AdMob Plus Environment Info:
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
Memory: 3.05 GB / 15.89 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-222.4459.24.2221.10121639
Languages:
Java: 11.0.17
npmPackages:
admob-plus-cordova: 2.0.0-alpha.16 => 2.0.0-alpha.16
admob-plus-cordova-native: 1.0.0-alpha.18 => 1.0.0-alpha.18
cordova-android: ^12.0.1 => 12.0.1
cordova-browser: 6.0.0 => 6.0.0
cordova-ios: 6.2.0 => 6.2.0
Cordova:
Version: 12.0.0 (cordova-lib@12.0.1)
Plugins:
admob-plus-cordova: 2.0.0-alpha.16
admob-plus-cordova-native: 1.0.0-alpha.18
Ionic:
Version: -
AndroidManifest.xml:
Version: -

@ratson
Copy link
Member

ratson commented Apr 12, 2024

Please update admob-plus-cordova to 2.0.0-alpha.17 and try again.

@vandilsondamata
Copy link
Author

Now the error message is gone, but nothing happens. The native ad is not displayed.

print2

npx admob-plus info

AdMob Plus Environment Info:
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
Memory: 621.30 MB / 15.89 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-222.4459.24.2221.10121639
Languages:
Java: 11.0.17
npmPackages:
admob-plus-cordova: 2.0.0-alpha.17 => 2.0.0-alpha.17
admob-plus-cordova-native: 1.0.0-alpha.18 => 1.0.0-alpha.18
cordova-android: ^12.0.1 => 12.0.1
cordova-browser: 6.0.0 => 6.0.0
cordova-ios: 6.2.0 => 6.2.0
Cordova:
Version: 12.0.0 (cordova-lib@12.0.1)
Plugins:
admob-plus-cordova: 2.0.0-alpha.17
admob-plus-cordova-native: 1.0.0-alpha.18
Ionic:
Version: -
AndroidManifest.xml:
Version: -

npx admob-plus doctor

√ googleads.g.doubleclick.net
‼ package.json
× cordova.plugins.admob-plus-cordova.APP_ID_ANDROID
› Test ID is used: ca-app-pub-3940256099942544~3347511713
√ Cordova Android dependencies
√ config.xml
↓ platforms/ios/*.xcodeproj
√ plugins/admob-plus-cordova/package.json

@ratson
Copy link
Member

ratson commented Apr 12, 2024

@vandilsondamata Are you using ca-app-pub-3940256099942544/2247696110 for the adUnitId?
You may refer to the updated example code.

@vandilsondamata
Copy link
Author

Yes, I updated the example code with the new adUnitId. Even so, it still doesn't display.
(Android Studio Log Print)
Print Log

Print 4

admob-plus doctor
√ googleads.g.doubleclick.net
‼ package.json
× cordova.plugins.admob-plus-cordova.APP_ID_ANDROID
› Test ID is used: ca-app-pub-3940256099942544~3347511713
√ Cordova Android dependencies
√ config.xml
↓ platforms/ios/*.xcodeproj
√ plugins/admob-plus-cordova/package.json

admob-plus info

AdMob Plus Environment Info:
System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz
Memory: 3.39 GB / 15.89 GB
Binaries:
Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-222.4459.24.2221.10121639
Languages:
Java: 11.0.17
npmPackages:
admob-plus-cordova: 2.0.0-alpha.17 => 2.0.0-alpha.17
admob-plus-cordova-native: 1.0.0-alpha.18 => 1.0.0-alpha.18
cordova-android: ^12.0.1 => 12.0.1
cordova-browser: 6.0.0 => 6.0.0
cordova-ios: 6.2.0 => 6.2.0
Cordova:
Version: 12.0.0 (cordova-lib@12.0.1)
Plugins:
admob-plus-cordova: 2.0.0-alpha.17
admob-plus-cordova-native: 1.0.0-alpha.18
Ionic:
Version: -
AndroidManifest.xml:
Version: -

@ratson
Copy link
Member

ratson commented Apr 15, 2024

@vandilsondamata Would you create a test repo for me to check?
I have no problem running the example code in this repo.

@vandilsondamata
Copy link
Author

After the corrections you made, I was able to view the native ads on a real device (not on the emulator). Thank you very much for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants