Open DmitryMaksimenko opened 2 years ago
Добрый день!Ваше письмо получено и зарегистрировано под уникальным номером № 15570851. Ответ обязательно будет предоставлен, пожалуйста, ожидайте.Просим Вас не отправлять повторное письмо по данному вопросу - оно будет считаться новой заявкой и может быть обработано позднее.Помощь сервиса: https://yandex.ru/support/direct/?from=email--С уважением,Отдел клиентского сервисател.: 8 800 234-24-80 (звонок из регионов России бесплатный)тел.: +7 495 739-37-77 18.01.2022, 20:49, "Dmitry Maksimenko" @.***>:
Create empty unity android project Import AppMetrica Import External Dependency Manager Enable "Custom Main Gradle Template" in Player Settings/Publishing Settings Resolve dependencies on Assets/External Dependency Manager/Android Resolver/Forse Resolve Run Build
Unity version 2020.3.26f1 AppMetrica version 4.1.0 External Dependency Manager version 1.2.168
2022-01-18 20:44:36.180 12970-12993/? E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: com.yandex.metrica.impl.ob.uf
java.lang.NoClassDefFoundError: com.yandex.metrica.impl.ob.uf
at com.yandex.metrica.impl.ob.uf.a(SourceFile:1)
at com.yandex.metrica.YandexMetrica.resumeSession(SourceFile:1)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:255)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
at com.yandex.metrica.impl.ob.d0.
—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>
@DmitryMaksimenko this is because metrica plugin doesn't use dependency.xml file that helps the External Dependency Manager resolve native libraries. This results in plain removal of those needed libraries during resolve.
@kbobnis AppMetrica devs should add xml with dependencies to the plugin to avoid such problems
I have created the dependency.xml File and local maven repo by myself. (I have not tested it on device yet, but I saw that the mobmetricalib.aar library was properly regenerated by external dependency manager).
How I did it:
<package_root>/m2repository/mobmetrica/mobmetricalib/4.1.1/
<package_root>/m2repository/mobmetrica/mobmetricalib/maven-metadata.xml
with contents<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>mobmetrica</groupId>
<artifactId>mobmetricalib</artifactId>
<versioning>
<release>4.1.1</release>
<versions>
<version>4.1.1</version>
</versions>
</versioning>
</metadata>
mobmetricalib-4.1.1.aar
to mobmetricalib-4.1.1.srcaar
and moved it to directory <package_root>/m2repository/mobmetrica/mobmetricalib/4.1.1/
<package_root>/m2repository/mobmetrica/mobmetricalib/4.1.1/mobmetricalib-4.1.1.pom
with contents:<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>mobmetrica</groupId>
<artifactId>mobmetricalib</artifactId>
<version>4.1.1</version>
<packaging>srcaar</packaging>
</project>
Created file <package_root>/Editor/AppMetricaDependencies.xml
with contents:
<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
<androidPackages>
<androidPackage spec="mobmetrica:mobmetricalib:4.1.1">
<repositories>
<repository>Assets/AppMetrica/m2repository</repository>
</repositories>
</androidPackage>
</androidPackages>
</dependencies>
Have the same issue. As a temporary solution, add this to your dependency.xml
...
<androidPackage spec="com.android.installreferrer:installreferrer:2.2">
<androidSdkPackageIds>
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
</androidSdkPackageIds>
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.2">
<androidSdkPackageIds>
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
</androidSdkPackageIds>
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
<androidPackage spec="org.jetbrains:annotations:13.0" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32" />
...
Same
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics; com.yandex.metrica.impl.ob.d0.<init>(SourceFile:9) com.yandex.metrica.impl.ob.d0.<init>(Unknown Source:2) com.yandex.metrica.impl.ob.X.<init>(SourceFile:17) com.yandex.metrica.impl.ob.X.<init>(SourceFile:7) com.yandex.metrica.impl.ob.X.g(SourceFile:5) com.yandex.metrica.impl.ob.uf.<clinit>(SourceFile:2) com.yandex.metrica.YandexMetrica.activate(SourceFile:1) 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:246) com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics ... 13 more UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0) UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0) YandexAppMetricaAndroid.ActivateWithConfiguration (YandexAppMetricaConfig config) (at <00000000000000000000000000000000>:0) AppMetrica.SetupMetrica () (at <00000000000000000000000000000000>:0)
and
java.lang.NoClassDefFoundError: com.yandex.metrica.impl.ob.uf com.yandex.metrica.impl.ob.uf.a(SourceFile:1) com.yandex.metrica.YandexMetrica.pauseSession(SourceFile:1) com.unity3d.player.UnityPlayer.nativePause(Native Method) com.unity3d.player.UnityPlayer.access$1900(Unknown Source:0) com.unity3d.player.UnityPlayer$24.run(Unknown Source:2) android.os.Handler.handleCallback(Handler.java:914) android.os.Handler.dispatchMessage(Handler.java:100) android.os.Looper.loop(Looper.java:225) com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics; com.yandex.metrica.impl.ob.d0.<init>(SourceFile:9) com.yandex.metrica.impl.ob.d0.<init>(Unknown Source:2) com.yandex.metrica.impl.ob.X.<init>(SourceFile:17) com.yandex.metrica.impl.ob.X.<init>(SourceFile:7) com.yandex.metrica.impl.ob.X.g(SourceFile:5) com.yandex.metrica.impl.ob.uf.<clinit>(SourceFile:2) com.yandex.metrica.impl.ob.uf.a(SourceFile:1) com.yandex.metrica.YandexMetrica.activate(SourceFile:1) 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:103) ... 2 more Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics ... 14 more UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0) UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0) YandexAppMetricaAndroid.PauseSession () (at <00000000000000000000000000000000>:0)
Попробуйте, пожалуйста, добавить следующие зависимости в файл: Assets/Plugin/Editor/Dependencies.xml:
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" />
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
Если файла нет, то необходимо его создать. Полный файл будет выглядеть следующим образом:
<dependencies>
<androidPackages>
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" />
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
</androidPackages>
</dependencies>
Please try adding the following dependencies to the file: Assets/Plugin/Editor/Dependencies.xml:
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" />
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
If there is no file, you need to create it. The full file will be like this:
<dependencies>
<androidPackages>
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" />
<androidPackage spec="com.android.installreferrer:installreferrer:2.2" />
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
</androidPackages>
</dependencies>
Попробуйте, пожалуйста, добавить следующие зависимости в файл: Assets/Plugin/Editor/Dependencies.xml:
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" /> <androidPackage spec="com.android.installreferrer:installreferrer:2.2" /> <androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
Если файла нет, то необходимо его создать. Полный файл будет выглядеть следующим образом:
<dependencies> <androidPackages> <androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" /> <androidPackage spec="com.android.installreferrer:installreferrer:2.2" /> <androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" /> </androidPackages> </dependencies>
Попробуйте добавить в файл следующие зависимости: Assets/Plugin/Editor/Dependencies.xml:
<androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" /> <androidPackage spec="com.android.installreferrer:installreferrer:2.2" /> <androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" />
Если файла нет, нужно его создать. Полный файл будет выглядеть так:
<dependencies> <androidPackages> <androidPackage spec="com.google.android.gms:play-services-appset:16.0.0" /> <androidPackage spec="com.android.installreferrer:installreferrer:2.2" /> <androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib:1.4.32" /> </androidPackages> </dependencies>
Помогло для ошибки com.yandex.metrica.impl.ob.uf при сборке для huawei hms.