Add gradle dependency to support android.util.ArrayMap

I have an example project that has a gradle dependency to support a library

compile 'com.android.support:support-v4:23.1.1'

When I run the program, sometimes this exception occurs:

Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.monkeyPatchExistingResources

I searched and found out that I should add this dependency to gradle:

compile "com.android.support:support-core-utils:23.3.0" 

or compile "com.android.support:support-core-utils:24.2.0"

So, I added a gradle dependency, but this time when I try to run the application, I get this error:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

What should I do?

+4
source share
1 answer

android.util.ArrayMapnot from the library. This is part of the Android firmware, but only on devices of API level 19+.

, minSdkVersion 19, , android.support.v4.util.ArrayMap.

+1

Source: https://habr.com/ru/post/1674420/


All Articles