facebook twitter hatena line email

「Unity/GoogleMobileAds/バージョンアップ/5.4.0から6.1.0へ」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
("version 31 and above"エラー対応)
("version 31 and above"エラー対応)
 
(同じ利用者による、間の1版が非表示)
行69: 行69:
 
  Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
 
  Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
  
 +
以下のようにimplementation('androidx.work:work-runtime:2.7.0')を追加
 +
 +
Assets/Plugins/Android/mainTemplate.gradle
 +
<pre>
 +
dependencies {
 +
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
 +
    constraints {
 +
        implementation('androidx.work:work-runtime:2.7.0') {
 +
            because 'previous versions have a bug impacting this application'
 +
        }
 +
    }
 +
}
 +
</pre>
 
参考:https://qiita.com/TAKANEKOMACHI/items/d0a23ae3ae3ac2a90dd7
 
参考:https://qiita.com/TAKANEKOMACHI/items/d0a23ae3ae3ac2a90dd7

2022年1月19日 (水) 16:37時点における最新版

バージョンアップ情報

  • Unity2020.3.1f1からUnity2020.3.17f1
  • GoogleMobileAds-v5.4.0から6.1.0へ
  • firebase_unity_sdk_7.1.0から8.1.0へ

テストデバイスID

AdRequest request;
request = new AdRequest.Builder()
    .AddTestDevice(testDeviceId)
    .Build();

新(RequestConfigurationで、設定することで、常にAdRequest requestがテストモードになると思われたが、テストモードにならない・・・謎)

List<string> deviceIds = new List<string>();
deviceIds.Add(testDeviceId);
RequestConfiguration requestConfiguration = new RequestConfiguration
    .Builder()
    .SetTestDeviceIds(deviceIds)
    .build();
MobileAds.SetRequestConfiguration(requestConfiguration);
// 広告リクエスト
AdRequest request = new AdRequest.Builder()
    .Build();

リワード更新

public void HandleRewardedAdFailedToLoad(object sender, AdErrorEventArgs args)
{
        MonoBehaviour.print(
            "HandleRewardedAdFailedToLoad event received with message: "
                             + args.Message);

public void HandleRewardedAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
{
            MonoBehaviour.print(
            "HandleRewardedAdFailedToLoad event received with message: "
                             + args.LoadAdError.GetMessage());

iosで_OBJC_CLASS_$_GULAppEnvironmentUtilエラーが出る場合

firebase_unity_sdk_8.1.0による影響と思われる。

以下エラーが発生

Showing Recent Messages
Undefined symbol: _OBJC_CLASS_$_GULAppEnvironmentUtil

1.以下対応

pod update

参考:https://qiita.com/Juliennu/items/85d57db2c70fe446d91a

2. xcodeで以下対応

XCode/Product/Clean Build Folder

参考:https://github.com/firebase/firebase-ios-sdk/issues/8137

"version 31 and above"エラー対応

Android12に対応した所以下エラーメッセージが出た。

Fatal Exception: java.lang.IllegalArgumentException
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

以下のようにimplementation('androidx.work:work-runtime:2.7.0')を追加

Assets/Plugins/Android/mainTemplate.gradle

dependencies {
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    constraints {
        implementation('androidx.work:work-runtime:2.7.0') {
            because 'previous versions have a bug impacting this application'
        }
    }
}

参考:https://qiita.com/TAKANEKOMACHI/items/d0a23ae3ae3ac2a90dd7