8

I started getting the message with the latest Android Build Tools (ABT) v19.0.3 today. At first glance, I thought this might be an issue with ABT. However, a closer investigation reveals that this message:

android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU

is only shown when Proguard is used. Answers on the net has yeilded no solution for me. Perhaps, this is only an issue with Proguard (the version I'm using is bundled with Android SDK v22.3).

I have added the following directives to proguard-project.txt file, but it makes no difference:

-keep interface android.support.v4.** { *; }
-keep class android.support.v4.** { *; }

Does anyone else come across this message and has a possible solution? Maybe Eric from Proguard might be able to shed some light into this issue. Maybe a code cleanup is required with Proguard? I'm interested to know the solution.

3
  • I faced the same issue today when set up proguard for my project. As this is just a Note I ignored it and my proguarded code runs well.
    – deko
    Mar 18 '14 at 11:54
  • Have you tried using something like -libraryjars $ANDROID_HOME/extras/android/support/v7/appcompat/libs/android-support-v4.jar ?
    – Shonzilla
    Mar 18 '14 at 11:54
  • @deko: Yes, I can use the dontwarn directive to ignore the comment. However, should Proguard even display this comment? @Shonzilla: Adding keep class android.support.v7.appcompat** { *; } or doing what you suggested above also do not remove the comment. That's why I'm stumped.
    – ChuongPham
    Mar 18 '14 at 12:18
18

The note says that a support class is using reflection to access a runtime class that isn't present in the target runtime. In general, it could be a sign of compatibility problems. In this case, it's harmless; the developers of the support library are precisely using reflection to avoid any linking problems with different runtime environments. You can suppress the note with:

-dontnote android.support.**
1
  • Thanks, Eric. I'll add your suggestion above to my project.
    – ChuongPham
    Mar 19 '14 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.