Checkout.createTokenizeIntent Fail
beretta9222 opened this issue · 1 comments
При попытке стартануть intent, созданный с помощью Checkout.createTokenizeIntent, приложение падает.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ykassa, PID: 5876
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/threatmetrix/TrustDefender/TrustDefender;
at ru.yandex.money.android.sdk.impl.ThreatMetrixProfilingTool.init(SourceFile:1)
at ru.yandex.money.android.sdk.impl.AppModel.init$library_metricaRealProdRelease(SourceFile:158)
at ru.yandex.money.android.sdk.impl.CheckoutInternal.tokenize$library_metricaRealProdRelease(SourceFile:40)
at ru.yandex.money.android.sdk.impl.CheckoutActivity.a(SourceFile:51)
at ru.yandex.money.android.sdk.impl.CheckoutActivity.onCreate(SourceFile:2)
at android.app.Activity.performCreate(Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.threatmetrix.TrustDefender.TrustDefender" on path: DexPathList[[zip file "/data/app/com.example.ykassa-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ykassa-1/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at ru.yandex.money.android.sdk.impl.ThreatMetrixProfilingTool.init(SourceFile:1)
at ru.yandex.money.android.sdk.impl.AppModel.init$library_metricaRealProdRelease(SourceFile:158)
at ru.yandex.money.android.sdk.impl.CheckoutInternal.tokenize$library_metricaRealProdRelease(SourceFile:40)
at ru.yandex.money.android.sdk.impl.CheckoutActivity.a(SourceFile:51)
at ru.yandex.money.android.sdk.impl.CheckoutActivity.onCreate(SourceFile:2)
at android.app.Activity.performCreate(Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
В gradle.properties выставлено:
android.enableR8 = true
Build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.ykassa"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
implementation 'com.yandex.money:checkout:4.0.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Не хватает классов из библиотеки TrustDefender.
- Нужно попросить у менеджера по подключению файл
ThreatMetrix Android SDK 5.4-73.aar
. - Создать папку
libs
в модуле где подключаете sdk и положить туда этот файл. - В блоке dependencies прописать
implementation fileTree(dir: "libs", include: ["*.aar"])
, в вашем случае уже есть*.jar
значит вам просто нужно добавить*.aar
Будет выглядеть примерно так:implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])