pavelzaichyk / flutter_unity_ads

Unity Ads plugin for Flutter Applications. This plugin is able to display Unity Banner Ads and Unity Video Ads.
https://pub.dev/packages/unity_ads_plugin
MIT License
31 stars 12 forks source link

UnityAds.init does not work #57

Closed appDevel1234 closed 2 months ago

appDevel1234 commented 3 months ago

Hi, thanks for this very great package!

For some days now I have the problem, that initializing unity ads does not work anymore on android devices. On iOS is everything working fine.

This is the code (... are just placeholders):

UnityAds.init(
        gameId: Platform.isAndroid ? '...' : '...',
        testMode: appIsInTestMode,
        onComplete: () => ...,
        onFailed: (error, errorMessage) => ...,
      );

Neither onComplete or onFailed is called, when I run UnityAds.init. It makes no different, if testMode is enabled or not. I use version 0.3.17 of the package and had the same problem in the version 0.3.9, which I used before.

UnityAds.isInitialized() returns false.

If I try to load an ad, then I got following error message:

Field loadTimeoutMs_ for f7.w1 not found. Known fields are [private int f7.w1.e, private int f7.w1.f, private int f7.w1.g, private static final f7.w1 f7.w1.m, private static volatile p5.z0 f7.w1.n]

Does anyone has an idea, what the problem could be?

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.7, on macOS 14.0 23A344 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.69.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
pavelzaichyk commented 2 months ago

Hi, check this solution https://github.com/pavelzaichyk/flutter_unity_ads/?tab=readme-ov-file#getting-unhandled-exception-platformexceptionerror-field-loadtimeoutms_-for-j2b2-not-found-when-running-the-application-on-android-in-release-mode