Closed JulieSolnceva closed 4 years ago
Добрый день. Можно попробовать несколько вещей: 1) Поднять targetSdkVersion и compileSdkVersion до 28 (это в любом случае нужно сделать, поскольку с августа это обязательно для выкладки в Google Play - https://developer.android.com/distribute/best-practices/develop/target-sdk) 2) Включить r8 и Jetifier Если это не помогло, то пришлите, пожалуйста, пустое приложение с настройками, где воспроизводится проблема, на b2b-app-support@yamoney.ru
Здравствуйте! Я установила SDK Яндекс.Кассы для Android в своё приложение. Хочу получить токен. Написала код как в вашем примере.
private void openYandex(){ HashSet methodType = new HashSet();
methodType.add(PaymentMethodType.BANK_CARD);
methodType.add(PaymentMethodType.SBERBANK);
На строке "startActivityForResult(intent, 1);" на устройствах Digma и Samsung приложение падает с ошибкой :
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.xx.xx, PID: 13340
java.lang.NoSuchMethodError: ru.yandex.money.android.sdk.impl.f.a.b.requireContext at ru.yandex.money.android.sdk.impl.f.a.b.onCreateView(Unknown Source) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:753) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149) at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013) at android.support.v4.app.Fragment.performStart(Fragment.java:2214) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1340) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149) at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013) at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:763) at ru.yandex.money.android.sdk.impl.CheckoutActivity.a(Unknown Source) at ru.yandex.money.android.sdk.impl.CheckoutActivity$a.invoke(Unknown Source) at ru.yandex.money.android.sdk.a.a$i.invoke(Unknown Source) at ru.yandex.money.android.sdk.impl.b.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5479) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) at dalvik.system.NativeStart.main(Native Method)
а на на устройствах Samsung добавляются ошибки: 08-07 13:27:53.011 787-1066/? E/Parcel: Class not found when unmarshalling: ru.yandex.money.android.sdk.PaymentParameters java.lang.ClassNotFoundException: ru.yandex.money.android.sdk.PaymentParameters at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:251) at java.lang.Class.forName(Class.java:216) at android.os.Parcel.readParcelableCreator(Parcel.java:2140) at android.os.Parcel.readParcelable(Parcel.java:2104) at android.os.Parcel.readValue(Parcel.java:2020) at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) at android.os.Bundle.unparcel(Bundle.java:249) at android.os.Bundle.getString(Bundle.java:1118) at android.content.Intent.getStringExtra(Intent.java:5148) at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1470) at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1066) at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4075) at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:3969) at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:159) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2650) at android.os.Binder.execTransact(Binder.java:404) at dalvik.system.NativeStart.run(Native Method) Caused by: java.lang.NoClassDefFoundError: ru/yandex/money/android/sdk/PaymentParameters at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:251) at java.lang.Class.forName(Class.java:216) at android.os.Parcel.readParcelableCreator(Parcel.java:2140) at android.os.Parcel.readParcelable(Parcel.java:2104) at android.os.Parcel.readValue(Parcel.java:2020) at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) at android.os.Bundle.unparcel(Bundle.java:249) at android.os.Bundle.getString(Bundle.java:1118) at android.content.Intent.getStringExtra(Intent.java:5148) at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1470) at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1066) at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4075) at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:3969) at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:159) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2650) at android.os.Binder.execTransact(Binder.java:404) at dalvik.system.NativeStart.run(Native Method) Caused by: java.lang.ClassNotFoundException: Didn't find class "ru.yandex.money.android.sdk.PaymentParameters" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:251) at java.lang.Class.forName(Class.java:216) at android.os.Parcel.readParcelableCreator(Parcel.java:2140) at android.os.Parcel.readParcelable(Parcel.java:2104) at android.os.Parcel.readValue(Parcel.java:2020) at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) at android.os.Bundle.unparcel(Bundle.java:249) at android.os.Bundle.getString(Bundle.java:1118) at android.content.Intent.getStringExtra(Intent.java:5148) at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1470) at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1066) at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4075) at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:3969) at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:159) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2650) at android.os.Binder.execTransact(Binder.java:404) at dalvik.system.NativeStart.run(Native Method) 08-07 13:27:53.221 13340-13340/com.xxx.xxx E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
Как мне устранить эти ошибки?
код build.gradle:
apply plugin: 'com.android.application'
android { compileSdkVersion 26 buildToolsVersion '28.0.3'
}
repositories { mavenCentral() maven { url 'https://dl.bintray.com/yandex-money/maven' } } dependencies {
}
configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.0' } } } }