1

ANT1.8.2とproguarg4.8.1を使用してプロジェクトを構築している間

 [proguard] Unexpected error while evaluating instruction:
 [proguard]   Class       = [android/support/v4/view/AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl]
 [proguard]   Method      = [newAccessiblityDelegateBridge(Landroid/support/v4/view/AccessibilityDelegateCompat;)Ljava/lang/Object;]
 [proguard]   Instruction = [18] areturn
 [proguard]   Exception   = [java.lang.IllegalArgumentException] (Can't find any super classes of [android/support/v4/view/AccessibilityDelegateCompatIcs$1] (not even immediate super class [android/view/View$AccessibilityDelegate]))
 [proguard] Unexpected error while performing partial evaluation:
 [proguard]   Class       = [android/support/v4/view/AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl]
 [proguard]   Method      = [newAccessiblityDelegateBridge(Landroid/support/v4/view/AccessibilityDelegateCompat;)Ljava/lang/Object;]
 [proguard]   Exception   = [java.lang.IllegalArgumentException] (Can't find any super classes of [android/support/v4/view/AccessibilityDelegateCompatIcs$1] (not even immediate super class [android/view/View$AccessibilityDelegate]))

BUILD FAILED
E:\adt-bundle-windows\sdk\tools\ant\build.xml:864: java.lang.IllegalArgumentException:     Can't find any super classes of [android/support/v4/view/AccessibilityDelegateCompatIcs$1] (not even immediate super class [android/view/View$AccessibilityDelegate])

android-support-v4.jarクラスパスとプロジェクトの依存関係にあります...Eclipseすべてのbut debugバージョンから正常にビルドされます。Antはそれらのエラーを表示します...

これをどのように回避しますか?Eclipseこれをビルドしても問題ない場合は、ビルドする必要があることも理解Antしています。

PS私のプロジェクトはandroid-10ターゲットであり、誰かがアドバイスする場合、私はそれをターゲット-16にすることはできません...

4

2 に答える 2

2

これらを proguard.cf に追加してみてはどうでしょうか?

-libraryjars   libs/android-support-v4.jar
-dontwarn android.support.v4.**    
-keep class android.support.v4.** { *; }  
-keep interface android.support.v4.app.** { *; }  
-keep public class * extends android.support.v4.**  
-keep public class * extends android.app.Fragment
于 2013-02-28T16:53:52.220 に答える
2

project.propertiesこの場合は 'android.view.View$AccessibilityDelegate' (SDK レベル 14 以上) を含むターゲット SDK を指定する必要があります。ProGuard の圧縮/最適化/難読化には、アプリケーションそのライブラリのコンパイルに使用されたものと少なくとも同じ基本 SDK が必要です。サポート ライブラリは、この最新の SDK に対してコンパイルされているため、ProGuard にも必要です。

AndroidManifest.xmlアプリケーションを実行するために、 で別のターゲット/最小/最大 SDK を指定することもできます。もちろん、アプリケーションがこれらの指定された SDK と実際に互換性があることを確認する必要があります。

于 2013-03-04T22:24:17.353 に答える