hyoromoのブログ

最近はVRSNS向けに作ったものについて書いています

古いProGuard設定に縛られしプロジェクトがADT22系にアップデートした時に発生かもしれないエラーの解決法

最近のイケてるプロジェクトは発生してないようですが、プロジェクトによっては以下の様なエラーが発生するかもしれません。

Proguard returned with error code 1. See console
MangaPageActivity: can't find referenced method 'android.view.Window getWindow()' in class jp.xx.xxxx.HogeActivity
(中略)
Warning: there were 39 unresolved references to program class members.
          Your input classes appear to be inconsistent.
          You may need to recompile them and try again.
          Alternatively, you may have to specify the option 
          '-dontskipnonpubliclibraryclassmembers'.

生きるのが辛くなってきますね。
これは android-support-v4.jar ライブラリをProGuardが見つけられなかった事が原因。解決するには proguard-project.txt なりの難読化定義が書かれてあるファイルの末尾に以下の一文を追加すればOK。

-libraryjars libs/android-support-v4.jar

相対パスなので、もし対象プロジェクトの android-support-v4.jar が存在するパスが違っている場合は適切なパスに置き換えてください。