android – 即时运行不起作用

android – 即时运行不起作用,第1张

概述前提 由于我使用android studio 2.0(发布版本),因此在编译我的应用程序时会得到许多内部类错误(这些似乎不相关,因为应用程序仍能正常工作).当我禁用即时运行时,我的应用程序工作正常,如果我启用它,应用程序崩溃 意见 编译时的错误如下: Error:warning: Ignoring InnerClasses attribute for an anonymous inner clas 前提

由于我使用android studio 2.0(发布版本),因此在编译我的应用程序时会得到许多内部类错误(这些似乎不相关,因为应用程序仍能正常工作).当我禁用即时运行时,我的应用程序工作正常,如果我启用它,应用程序崩溃

意见

编译时的错误如下:

Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(com.samsung.androID.sdk.pass.e) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(com.samsung.androID.sdk.pass.a) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(com.samsung.androID.sdk.pass.b) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(com.samsung.androID.sdk.pass.c) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(com.samsung.androID.sdk.pass.d) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegImageParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegImageParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegImageParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegImageParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegImageParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.JpegUtils) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.exifRewrite.ExifRewriter) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.iptc.IPTCParser) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.iptc.IPTCRecord) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.jpeg.xmp.JpegRewriter) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.tiff.TiffElement) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.tiff.write.TiffOutputDirectory) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.tiff.write.TiffImageWriterLossless) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.formats.tiff.write.TiffImageWriterLossless) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.icc.IccConstants) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.icc.IccConstants) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.icc.IccConstants) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.icc.IccConstants) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.icc.IccConstants) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.palette.MedianCutQuantizer) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(org.apache.sanselan.palette.MedianCutQuantizer) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError: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

这对我意味着什么?我必须克隆大型构建错误块中提到的所有库并在本地编译它们而不是通过gradle导入它们?

解决方法 发生的事情是您没有为可序列化类定义自己的serialVersionUID,因此JDK会自行计算.但是,在启用Instant-Run(IR)和禁用时构建的计算版本会有所不同.
因此,使用具有IR的应用程序版本将无法重新加载在没有它的情况下构建的序列化类,因为UID是不同的.

解决方案是在序列化的所有类中定义自己的serialVersionUID. It’s best Java Serialization practice anyway

总结

以上是内存溢出为你收集整理的android – 即时运行不起作用全部内容,希望文章能够帮你解决android – 即时运行不起作用所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1135944.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存