2016-04-14 5 views
7

インスタント実行私のアプリをコンパイルするとき、私は多くの内部クラスerrosを得る前提条件

を動作しない(アプリはまだ正常に動作として、これらは、関連性がないように見えます)。私はインスタント実行を無効にすると、私のアプリは、完全に正常に動作し、私はそれを有効にした場合、アプリは以下の通りです

観察

エラーをコンパイル中にクラッシュ:

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(com.samsung.android.sdk.pass.e) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(com.samsung.android.sdk.pass.a) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(com.samsung.android.sdk.pass.b) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(com.samsung.android.sdk.pass.c) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(com.samsung.android.sdk.pass.d) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegImageParser$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegImageParser$2) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegImageParser$3) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegImageParser$4) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegImageParser$5) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.JpegUtils$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.iptc.IPTCParser$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.iptc.IPTCRecord$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter$2) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter$3) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter$4) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.tiff.TiffElement$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.tiff.write.TiffOutputDirectory$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.tiff.write.TiffImageWriterLossless$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.formats.tiff.write.TiffImageWriterLossless$2) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.icc.IccConstants$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.icc.IccConstants$2) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.icc.IccConstants$3) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.icc.IccConstants$4) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.icc.IccConstants$5) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.palette.MedianCutQuantizer$1) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class 
Error:(org.apache.sanselan.palette.MedianCutQuantizer$2) that doesn't come with an 
Error:associated EnclosingMethod attribute. This class was probably produced by a 
Error:compiler that did not target the modern .class file format. The recommended 
Error:solution is to recompile the class from source, using an up-to-date compiler 
Error:and without specifying any "-target" type options. The consequence of ignoring 
Error:this warning is that reflective operations on this class will incorrectly 
Error:indicate that it is *not* an inner class. 

は、その後、私はエラーが発生する場合を取得します次のようにアプリを起動します(インスタント実行を有効にした場合のみ):

com.app.test.data.DataManager$ExistingDataSources; Incompatible class (SUID): com.app.test.data.DataManager$ExistingDataSources: static final long serialVersionUID =4867698184298054210L; but expected com.app.test.data.DataManager$ExistingDataSources: static final long serialVersionUID =2877622586407293138L; 
java.io.InvalidClassException: com.app.test.data.DataManager$ExistingDataSources; Incompatible class (SUID): com.app.test.data.DataManager$ExistingDataSources: static final long serialVersionUID =4867698184298054210L; but expected com.app.test.data.DataManager$ExistingDataSources: static final long serialVersionUID =2877622586407293138L; 

完全なログはこちら:https://gist.github.com/MFlisar/3514ad2af4b4de692d228da0e1264015

質問

それは私にとって何を意味するのでしょうか?ビルドエラーブロックに記載されているすべてのライブラリをクローンして、それらをgrale経由でインポートするのではなくローカルでコンパイルする必要がありますか?インスタントファイル名を指定して実行を無効に

+0

アプリがクラッシュしたときのログは何ですか? –

+0

プロガード問題のようです。 '-keepclassmembers class * implements java.io.Serializable'を追加しましたか? –

+0

私は完全な関連ログを要点を追加しました... @PedroOliveiraデバッグビルドのためにプロガードを無効にしました...プロガードルールを追加しても何も変更されません... – prom85

答えて

0

は私がサービスとしていた問題、クラスおよびフラグメント

設定]> [ビルドを解決します場合は、実行、配備>インスタントファイル名を指定して実行>のチェックを外し、しかし

を「インスタントファイル名を指定して実行を有効にします」インスタント実行を維持したい "コード変更のアクティビティの再開"のチェックを外すだけで試すことができます

環境設定>ビルド、実行、展開>インスタント実行> Unche ck「コード変更によるアクティビティの再開」

0

Instant Runによって多数のバグが導入されていますが、新しいバージョンではますます少なくなりました。あなたはアンドロイドスタジオの最新の安定版を更新する必要がありますまた、Gradleプラグインをチェックすることについても確認してくださいそれでも解決策が見つからない場合はインスタント実行を無効にしてください他の回答提案やこの質問を参照してくださいすることができますhereまた、 this answerかなり便利です。

submit bug hereです。

3

あなたのシリアライズ可能なクラスに独自のserialVersionUIDを定義しておらず、JDKが独自に計算するということが起こっています。ただし、インスタント実行(IR)を有効にしてビルドすると、計算されたバージョンが異なります。 したがって、UIDが異なるため、IRでアプリケーションのバージョンを使用すると、シリアル化されていないクラスを再ロードすることができません。

解決方法は、シリアル化するすべてのクラスでserialVersionUIDを独自に定義することです。It's best Java Serialization practice anyway

+0

私はちょうどCommonsWareのブロックを読んだことが...私はそれを確認します。当時私は手動でUIDを定義していたと確信していますが、再試行します... – prom85

0

-keepattributes EnclosingMethod 

をproguard-rules.proするために、この行を追加します。このエラーは、私が思うに、のInnerClassesを持っているほとんどすべてのクラスを発生する可能性があります。 (support.v4などのように)私のために。私は 2.2 Androidのスタジオでテストしてみた

(log4jのをテストしたわけではありません。support.v4などをテスト済み)

build.gradle

compileSdkVersion 24 
buildToolsVersion "24.0.2" 
... 
minifyEnabled true 
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
... 
dependencies { 
    ... 
    compile 'com.android.support:support-v4:24.2.1' 
} 

getDefaultProguardFile( 'ProGuardの-アンドロイド-optimize.txt' )も機能します。

関連する問題