yandexmobile / yandex-ads-unity-plugin

Yandex Mobile Ads Unity Plugin
Other
54 stars 11 forks source link

Ошибка при запросе рекламы через тестовый скрипт #51

Closed sakura-gamedev closed 1 year ago

sakura-gamedev commented 1 year ago

Использую версию пакета 2.6.0, выполнил Resolve и сделал тестовую сцену на котором лежит скрипт YandexMobileAdsRewardedAdDemoScript. Билдится успешно, но при попытке запросить рекламу вылезает следующая ошибка.

AndroidJavaException: java.lang.ClassNotFoundException: com.yandex.mobile.ads.common.MobileAds

java.lang.ClassNotFoundException: com.yandex.mobile.ads.common.MobileAds
java.lang.Class.classForName(Native Method)
java.lang.Class.forName(Class.java:454)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:236)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.yandex.mobile.ads.common.MobileAds" on path: DexPathList[[zip file "/data/app/~~jv7hte39FjwZOb7oOoiRrg==/com.game.gamename-cXeTN0BEUWwFeUoDGLKGWA==/base.apk"],nativeLibraryDirectories=[/data/app/~~jv7hte39FjwZOb7oOoiRrg==/com.game.gamename-cXeTN0BEUWwFeUoDGLKGWA==/lib/arm64, /data/app/~~jv7hte39FjwZOb7oOoiRrg==/com.game.gamename-cXeTN0BEUWwFeUoDGLKGWA==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64, /system/product/lib64]]
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
java.lang.ClassLoader.loadClass(ClassLoader.java:379)
java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 8 more
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.FindClass (System.String name) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaProxy..ctor (System.String javaInterface) (at <00000000000000000000000000000000>:0)
YandexMobileAds.Platforms.Android.MobileAdsClient..ctor () (at <00000000000000000000000000000000>:0)
YandexMobileAds.Platforms.Android.MobileAdsClient.GetInstance () (at <00000000000000000000000000000000>:0)
YandexMobileAds.MobileAds.SetAgeRestrictedUser (System.Boolean ageRestrictedUser) (at <00000000000000000000000000000000>:0)
YandexMobileAdsRewardedAdDemoScript.RequestRewardedAd () (at <00000000000000000000000000000000>:0)
YandexMobileAdsRewardedAdDemoScript.OnGUI () (at <00000000000000000000000000000000>:0)
mobile-ads-github commented 1 year ago

Здравствуйте, какой пакет вы импортировали? После импорта пакета в ассетах вашего проекта появился файл project/Assets/YandexMobileAds/Editor/YandexMobileadsDependencies.xml ? Какие файлы у вас расположены в этой директории после импорта пакетов project/Assets/YandexMobileAds/Editor/? Какую версию Resolver вы используете?

sakura-gamedev commented 1 year ago

В папке Assets/YandexMobileAds/Editor/ находятся

  1. PostprocessBuildPlayerYandexMobileAds.cs
  2. YandexMobileadsDependencies.xml

Версия Resolver'a 1.2.175 Импортировал пакет yandex-mobileads-lite-2.6.0.unitypackage

mobile-ads-github commented 1 year ago

При резолве зависимостей через Resolver добавляются зависимости в файл project/Assets/Plugins/Android/mainTemplate.gradle. После импорта пакета и резолва зависимостей у вас появилась строка: implementation 'com.yandex.android:mobileads:5.5.0'? Какое содержимое файла лежит в sample-yandex/ProjectSettings/AndroidResolverDependencies.xml? Также, попробуйте пожалуйста воспользоваться Resolver версии 1.2.137.

Какую версию Unity вы используете?

sakura-gamedev commented 1 year ago

У меня нет файла Assets/Plugins/Android/mainTemplate.gradle, ибо не было необходимости и об этом в Readme не сказано. Версия Unity 2021.3.16f1

Содержимое файла ProjectSettings/AndroidResolverDependencies.xml

<dependencies>
  <packages>
    <package>com.amplitude:android-sdk:2.30.1</package>
    <package>com.facebook.android:facebook-applinks:[11.0, 12)</package>
    <package>com.facebook.android:facebook-core:[11.0, 12)</package>
    <package>com.facebook.android:facebook-gamingservices:[11.0, 12)</package>
    <package>com.facebook.android:facebook-login:[11.0, 12)</package>
    <package>com.facebook.android:facebook-share:[11.0, 12)</package>
    <package>com.parse.bolts:bolts-android:1.4.0</package>
    <package>com.squareup.okhttp3:okhttp:4.2.2</package>
    <package>com.yandex.android:mobileads:5.5.0</package>
  </packages>
  <files />
  <settings>
    <setting name="androidAbis" value="arm64-v8a,armeabi-v7a" />
    <setting name="bundleId" value="com.game.gamename" />
    <setting name="explodeAars" value="False" />
    <setting name="gradleBuildEnabled" value="True" />
    <setting name="gradlePropertiesTemplateEnabled" value="False" />
    <setting name="gradleTemplateEnabled" value="False" />
    <setting name="installAndroidPackages" value="False" />
    <setting name="localMavenRepoDir" value="Assets/GeneratedLocalRepo" />
    <setting name="packageDir" value="Assets/Plugins/Android" />
    <setting name="patchAndroidManifest" value="False" />
    <setting name="patchMainTemplateGradle" value="False" />
    <setting name="projectExportEnabled" value="False" />
    <setting name="useJetifier" value="False" />
  </settings>
</dependencies>

Попробую создать Custom Main Gradle Template и ещё раз использовать Resolve

sakura-gamedev commented 1 year ago

Стоит упомянуть, что периодически появляются проблемы после резолва с jetified библиотеками, а без включения UseJetifier не работает и выдает ошибку резолва.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.yandex.android.beacon.BeaconItem found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.BeaconItem$NonPersistent found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.BeaconItem$Persistent found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconConfiguration found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconDb found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconDb$Companion found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconDb$Companion$factory$1 found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconDb$Factory found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconManager found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconManager$Companion found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconPerWorkerLogger found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconPerWorkerLogger$Companion found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconPerWorkerLogger$Logcat found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconPerWorkerLogger$NoOp found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconRequest found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconRequest$Companion found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconRequestExecutor found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconResponse found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorker found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorker$Callback found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$Companion found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$ImplThread found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$ImplThread$workerData$2 found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$RunningJob found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$WorkerData found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$WorkerData$iterator$1 found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerImpl$WorkerThreadExecutor found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.beacon.SendBeaconWorkerScheduler found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.net.CookieStorage found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.net.CookieStorage$NoOp found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.android.util.SerializationUtils found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.div.BuildConfig found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.DivApi found in modules jetified-com.yandex.div.div-data-14.0.0-runtime.jar (:com.yandex.div.div-data-14.0.0:) and jetified-div-data-14.0.0-runtime.jar (com.yandex.div:div-data:14.0.0)
  Duplicate class com.yandex.div.DivBlockWithId found in modules jetified-com.yandex.div.div-data-14.0.0-runtime.jar (:com.yandex.div.div-data-14.0.0:) and jetified-div-data-14.0.0-runtime.jar (com.yandex.div:div-data:14.0.0)
  Duplicate class com.yandex.div.DivDataTag found in modules jetified-com.yandex.div.div-core-14.0.0-runtime.jar (:com.yandex.div.div-core-14.0.0:) and jetified-div-core-14.0.0-runtime.jar (com.yandex.div:div-core:14.0.0)
  Duplicate class com.yandex.div.beacon.BuildConfig found in modules jetified-beacon-14.0.0-runtime.jar (com.yandex.div:beacon:14.0.0) and jetified-com.yandex.div.beacon-14.0.0-runtime.jar (:com.yandex.div.beacon-14.0.0:)
  Duplicate class com.yandex.div.core.BuildConfig found in modules jetified-com.yandex.div.div-core-14.0.0-runtime.jar (:com.yandex.div.div-core-14.0.0:) and jetified-div-core-14.0.0-runtime.jar (com.yandex.div:div-core:14.0.0)
  Duplicate class com.yandex.div.core.CompositeDisposable found in modules jetified-com.yandex.div.utils-14.0.0-runtime.jar (:com.yandex.div.utils-14.0.0:) and jetified-utils-14.0.0-runtime.jar (com.yandex.div:utils:14.0.0)
  Duplicate class com.yandex.div.core.CompositeDisposableKt found in modules jetified-com.yandex.div.utils-14.0.0-runtime.jar (:com.yandex.div.utils-14.0.0:) and jetified-utils-14.0.0-runtime.jar (com.yandex.div:utils:14.0.0)
  Duplicate class com.yandex.div.core.DecodeBase64ImageTask found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DecodeBase64ImageTask$run$setImageRunnable$1 found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Disposable found in modules jetified-com.yandex.div.utils-14.0.0-runtime.jar (:com.yandex.div.utils-14.0.0:) and jetified-utils-14.0.0-runtime.jar (com.yandex.div:utils:14.0.0)
  Duplicate class com.yandex.div.core.Div2Context found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Div2Context$Div2InflaterFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Div2Context$Div2InflaterFactory$Companion found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Div2ImageStubProvider found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Div2Logger found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.Div2Logger$1 found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivActionHandler found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivAutoLogger found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivAutoLogger$1 found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration$1 found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration$Builder found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetActionHandlerFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetAreVisualErrorsEnabledFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDisplayTypefaceProviderFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDiv2ImageStubProviderFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDiv2LoggerFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivCustomViewAdapterFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivCustomViewFactoryFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivDataChangeListenerFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivDownloaderFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivStateCacheFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivStateChangeListenerFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetDivVisibilityChangeListenerFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetExtensionHandlersFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yandex.div:div:14.0.0)
  Duplicate class com.yandex.div.core.DivConfiguration_GetImageLoaderFactory found in modules jetified-com.yandex.div.div-14.0.0-runtime.jar (:com.yandex.div.div-14.0.0:) and jetified-div-14.0.0-runtime.jar (com.yand<message truncated>
mobile-ads-github commented 1 year ago

Добрый день!

Убедитесь, пожалуйста, что выполнили каждый из этих пунктов: 1) Импортировали yandex-mobileads-lite-2.6.0.unitypackage через Assets -> Import Package -> Custom Package (нужно убедиться, что галочки стоят напротив всех файлов) 2) Добавили скрипт YandexMobileAdsRewardedAdDemoScript через MainCamera -> Add Component -> Scripts 3) Выполнили resolve зависимостей через Assets -> External Dependency Manager -> Android Resolver -> Force Resolve

Если это не помогло, скажите, пожалуйста, что происходит на 3 этапе, все ли проходит успешно или же появляется какая-либо ошибка

Так же прикрепляем пример пустого рабочего проекта https://disk.yandex.ru/d/-4bDCHfRCAVqnA

Спасибо!

sakura-gamedev commented 1 year ago
  1. Переустановил пакет,
  2. Сделал тестовую сцену
    • Создал пустую сцену,
    • удалил все объекты,
    • добавил пустой объект и повесил на него YandexMobileAdsRewardedAdDemoScript
    • Добавил LunarConsole
  3. зарезолвил зависимости через Force Resolve
  4. Собрал Development build иии ... получил новую ошибку

Я так понимаю этот фикс ещё в Юнити плагин не закинули, т.к. в Unity версия рекламы 5.5.0

AndroidJavaException: com.yandex.mobile.ads.impl.o40: SDK API usage from a background thread detected. Please, use SDK API just from the main thread.

com.yandex.mobile.ads.impl.o40: SDK API usage from a background thread detected. Please, use SDK API just from the main thread.
com.yandex.mobile.ads.impl.h70.a(SourceFile:3)
com.yandex.mobile.ads.rewarded.RewardedAd.<init>(SourceFile:4)
com.yandex.mobile.ads.unity.wrapper.rewarded.a.a(Unknown Source:2)
com.yandex.mobile.ads.unity.wrapper.rewarded.RewardedAdWrapper.<init>(Unknown Source:10)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:236)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.NewObject (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[] args) (at <00000000000000000000000000000000>:0)
YandexMobileAds.Platforms.Android.RewardedAdClient..ctor (System.String blockId) (at <00000000000000000000000000000000>:0)
YandexMobileAds.Platforms.YandexMobileAdsClientFactory.BuildRewardedAdClient (System.String blockId) (at <00000000000000000000000000000000>:0)
YandexMobileAds.RewardedAd..ctor (System.String blockId) (at <00000000000000000000000000000000>:0)
YandexMobileAdsRewardedAdDemoScript.RequestRewardedAd () (at <00000000000000000000000000000000>:0)
YandexMobileAdsRewardedAdDemoScript.OnGUI () (at <00000000000000000000000000000000>:0)
mobile-ads-github commented 1 year ago

Добрый день!

Данная проблема будет исправлена в ближайшем релизе.

mobile-ads-github commented 1 year ago

Добрый день, вышел релиз 2.7.0

sakura-gamedev commented 1 year ago

В итоге всё это дело пофиксилось через

  1. Обновление плагина Unity до нативного со стороны Яндекса
  2. Полное удаление YandexSDK из папок Assets и Assets/Plugins
  3. Delete Resolved Libraries, Force Resolve
  4. Импорт ещё раз
  5. Delete Resolved Libraries, Force Resolve

п.с. Кастомные конфиги в проекте не используются. Ещё при успешном запросе пишет, что рекламы нет, но кажется это не проблема SDK

mobile-ads-github commented 1 year ago

Ещё при успешном запросе пишет, что рекламы нет, но кажется это не проблема SDK

Вы используете демо-блок или кастомный блок из партнерского интерфейса? На демо-блоке должен быть стабильный подбор. Если по каким-то причинам у Вас это не так, тогда нам нужны детали и будем разбираться.

sakura-gamedev commented 1 year ago

Вы используете демо-блок или кастомный блок из партнерского интерфейса? На демо-блоке должен быть стабильный подбор. Если по каким-то причинам у Вас это не так, тогда нам нужны детали и будем разбираться.

Использовался кастомный блок с выставленной Google Play ссылкой