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
32 stars 13 forks source link

Load Failed [PLACEMENT_ID]: UnityAdsLoadError.invalidArgument adMarkup is missing; objectId is missing #40

Closed kkjk1176 closed 5 months ago

kkjk1176 commented 1 year ago

I don't know what's wrong.

Error log

flutter: UnityAds Load Failed [PLACEMENT_ID]: UnityAdsLoadError.invalidArgument adMarkup is missing; objectId is missing
flutter: Video Ad [PLACEMENT_ID] failed: UnityAdsShowError.notReady Placement not ready

UnityDoc

스크린샷 2023-06-13 오후 4 59 43 스크린샷 2023-06-13 오후 5 00 11

Code

class AdsWidget extends ConsumerState<AdsWidget> with WidgetsBindingObserver {

  late final String rewardedAdsId;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);

    rewardedAdsId = Platform.isAndroid ? Env.UNITY_ADS_REWARDED_AD_UNIT_ID_AOS : Env.UNITY_ADS_REWARDED_AD_UNIT_ID_IOS;

    UnityAds.init(
      gameId: Platform.isAndroid ? Env.UNITY_ADS_GAME_ID_AOS : Env.UNITY_ADS_GAME_ID_IOS,
      testMode: true,
      onComplete: () async {
        await UnityAds.setPrivacyConsent(PrivacyConsentType.gdpr, true);
        await UnityAds.setPrivacyConsent(PrivacyConsentType.ageGate, true);
        await UnityAds.setPrivacyConsent(PrivacyConsentType.ccpa, true);
        await UnityAds.setPrivacyConsent(PrivacyConsentType.pipl, true);
        print('[ UnityAds Initialization Complete! ]');
      },
      onFailed: (error, msg) => ('[ UnityAds Initialization Failed ] : $error | $msg'),
    );
  }

...

  @override
  Widget build(BuildContext context) {

    return TapScaleAnimation(
       ...
      onTap: () async{

          await UnityAds.load(
              placementId: rewardedAdsId,
              onComplete: (placementId) => print('UnityAds Load Complete $placementId'),
              onFailed: (placementId, error, message) => print('UnityAds Load Failed $placementId: $error $message'),
            );

            await UnityAds.showVideoAd(
              placementId: rewardedAdsId,
              onStart: (placementId) => print('Video Ad $placementId started'),
              onClick: (placementId) => print('Video Ad $placementId click'),
              onSkipped: (placementId) => print('Video Ad $placementId skipped'),
              onComplete: (placementId) => print('Video Ad $placementId completed'),
              onFailed: (placementId, error, message) => print('Video Ad $placementId failed: $error $message'),
            );
      },
      child: AnimatedSize(
        ...
}

Used IDs

스크린샷 2023-06-13 오후 4 53 53
HosseinArabbeigi commented 1 year ago

Any update here?

icodelifee commented 1 year ago

New project > use only unity ads options, mediation one wont work

Us3rL0sT commented 1 year ago

are you sure it worked? I couldn 't just install unity ads , the problem remained

AyoubSmina commented 10 months ago

any progress ??!

Us3rL0sT commented 10 months ago

I start use appodeal, so try it too. there easy to connect unity and others

any progress ??!

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.