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

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

Open
kkjk1176 opened this issue Jun 13, 2023 · 6 comments
Labels

Comments

@kkjk1176
Copy link

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
Copy link

Any update here?

@icodelifee
Copy link

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

@Us3rL0sT
Copy link

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

@AyoubSmina
Copy link

any progress ??!

@Us3rL0sT
Copy link

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

any progress ??!

Copy link

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

@github-actions github-actions bot added the stale label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants