私はGuiceをAndroidのMavenプロジェクトで実行し、サードパーティのモジュールにバンドルさせようとしています。通常のテストでは正常に実行されますが、以下のlogcatメッセージでVMに失敗します。AndroidのmavenプロジェクトでGuiceとVerrifyError
私が理解できないことは、GuiceがAndroidでうまく動作しているという報告が多数あることです。それにもかかわらず、私のコードは、Guiceインジェクタから呼び出されるgetBeanInfo()で失敗するようです。私はこのエラーがある唯一の人ではないようです。
だから私は、質問のカップルを持っています。 Guiceが私のために働いていないのは、私のサードパーティのモジュールがどこかで失敗するかもしれないが一般的ではない機能があるからです。特定の原因となっているgetBeanInfo()を引き起こしているものについて、Guiceから情報を得る方法はありますか?回避策はありますか?さらなるデバッグのために、私にはどのような手段がありますか?
同様の問題のEclipse設定を調整する同様の質問に対する回答は適用できないため、解決策は互換性があります。 Getting "Caused by: java.lang.VerifyError:" (私はとにかくここに多くのマイレージを持っているわけではない)。
私は、関連するすべてのファイルが依存性として、アンドロイドMavenプラグインによってDXで処理されたことを考える:「コンパイル」ツリーがスコープで、関連するすべてのプロジェクトを示したが、私はここには専門家です。
03-05 00:57:34.529: I/dalvikvm(2295): threadid=3: reacting to signal 3 03-05 00:57:34.568: I/dalvikvm(2295): Wrote stack traces to '/data/anr/traces.txt' 03-05 00:57:35.059: I/dalvikvm(2295): threadid=3: reacting to signal 3 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): Could not load Finalizer in its own class loader. Loading Finalizer in the current class loader instead. As a result, you will not be able to garbage collect this class loader. To support reclaiming this class loader, either resolve the underlying issue, or move Google Collections to your system class path. 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.getBaseUrl(FinalizableReferenceQueue.java:269) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.loadFinalizer(FinalizableReferenceQueue.java:253) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$FinalizableReferenceQueue.loadFinalizer(FinalizableReferenceQueue.java:175) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$FinalizableReferenceQueue.(FinalizableReferenceQueue.java:100) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$MapMaker$QueueHolder.(MapMaker.java:787) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$MapMaker$WeakEntry.(MapMaker.java:946) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$MapMaker$Strength$1.newEntry(MapMaker.java:312) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:498) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(MapMaker.java:419) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2029) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(Annotations.java:116) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.Annotations.isScopeAnnotation(Annotations.java:124) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.ScopeBindingProcessor.visit(ScopeBindingProcessor.java:40) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.ScopeBindingProcessor.visit(ScopeBindingProcessor.java:30) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.spi.ScopeBinding.acceptVisitor(ScopeBinding.java:59) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:55) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:165) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.Guice.createInjector(Guice.java:95) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.Guice.createInjector(Guice.java:72) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.google.inject.Guice.createInjector(Guice.java:62) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at za.co.mambo.cherrylist.android.CherryListActivity.onCreate(CherryListActivity.java:27) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.Activity.performCreate(Activity.java:4465) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.ActivityThread.access$600(ActivityThread.java:123) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.os.Handler.dispatchMessage(Handler.java:99) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.os.Looper.loop(Looper.java:137) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at android.app.ActivityThread.main(ActivityThread.java:4424) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at java.lang.reflect.Method.invokeNative(Native Method) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at java.lang.reflect.Method.invoke(Method.java:511) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 03-05 00:57:35.098: W/nalizableReferenceQueue(2295): at dalvik.system.NativeStart.main(Native Method) 03-05 00:57:35.108: I/dalvikvm(2295): Wrote stack traces to '/data/anr/traces.txt' 03-05 00:57:35.338: D/dalvikvm(2295): GC_CONCURRENT freed 391K, 4% free 12676K/13127K, paused 8ms+5ms 03-05 00:57:35.418: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.418: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.418: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.418: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.418: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.428: W/dalvikvm(2295): VFY: unable to find class referenced in signature ([Ljava/beans/PropertyDescriptor;) 03-05 00:57:35.438: I/dalvikvm(2295): Could not find method java.beans.Introspector.getBeanInfo, referenced from method com.google.inject.internal.cglib.core.$ReflectUtils.getPropertiesHelper 03-05 00:57:35.438: W/dalvikvm(2295): VFY: unable to resolve static method 8989: Ljava/beans/Introspector;.getBeanInfo (Ljava/lang/Class;Ljava/lang/Class;)Ljava/beans/BeanInfo; 03-05 00:57:35.438: D/dalvikvm(2295): VFY: replacing opcode 0x71 at 0x000c 03-05 00:57:35.458: W/dalvikvm(2295): VFY: unable to resolve exception class 1373 (Ljava/beans/IntrospectionException;) 03-05 00:57:35.458: W/dalvikvm(2295): VFY: unable to find exception handler at addr 0x4e 03-05 00:57:35.458: W/dalvikvm(2295): VFY: rejected Lcom/google/inject/internal/cglib/core/$ReflectUtils;.getPropertiesHelper (Ljava/lang/Class;ZZ)[Ljava/beans/PropertyDescriptor; 03-05 00:57:35.458: W/dalvikvm(2295): VFY: rejecting opcode 0x0d at 0x004e 03-05 00:57:35.458: W/dalvikvm(2295): VFY: rejected Lcom/google/inject/internal/cglib/core/$ReflectUtils;.getPropertiesHelper (Ljava/lang/Class;ZZ)[Ljava/beans/PropertyDescriptor; 03-05 00:57:35.458: W/dalvikvm(2295): Verifier rejected class Lcom/google/inject/internal/cglib/core/$ReflectUtils; 03-05 00:57:35.488: D/AndroidRuntime(2295): Shutting down VM 03-05 00:57:35.498: W/dalvikvm(2295): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 03-05 00:57:35.508: I/dalvikvm(2295): threadid=3: reacting to signal 3 03-05 00:57:35.548: I/dalvikvm(2295): Wrote stack traces to '/data/anr/traces.txt' 03-05 00:57:35.568: E/AndroidRuntime(2295): FATAL EXCEPTION: main 03-05 00:57:35.568: E/AndroidRuntime(2295): java.lang.RuntimeException: Unable to start activity ComponentInfo{za.co.mambo.cherrylist.android/za.co.mambo.cherrylist.android.CherryListActivity}: com.google.inject.internal.util.$ComputationException: java.lang.VerifyError: com/google/inject/internal/cglib/core/$ReflectUtils 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread.access$600(ActivityThread.java:123) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.os.Handler.dispatchMessage(Handler.java:99) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.os.Looper.loop(Looper.java:137) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread.main(ActivityThread.java:4424) 03-05 00:57:35.568: E/AndroidRuntime(2295): at java.lang.reflect.Method.invokeNative(Native Method) 03-05 00:57:35.568: E/AndroidRuntime(2295): at java.lang.reflect.Method.invoke(Method.java:511) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 03-05 00:57:35.568: E/AndroidRuntime(2295): at dalvik.system.NativeStart.main(Native Method) 03-05 00:57:35.568: E/AndroidRuntime(2295): Caused by: com.google.inject.internal.util.$ComputationException: java.lang.VerifyError: com/google/inject/internal/cglib/core/$ReflectUtils 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.FailableCache.get(FailableCache.java:50) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:521) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:847) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.Guice.createInjector(Guice.java:95) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.Guice.createInjector(Guice.java:72) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.Guice.createInjector(Guice.java:62) 03-05 00:57:35.568: E/AndroidRuntime(2295): at za.co.mambo.cherrylist.android.CherryListActivity.onCreate(CherryListActivity.java:27) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.Activity.performCreate(Activity.java:4465) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 03-05 00:57:35.568: E/AndroidRuntime(2295): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 03-05 00:57:35.568: E/AndroidRuntime(2295): ... 11 more 03-05 00:57:35.568: E/AndroidRuntime(2295): Caused by: java.lang.VerifyError: com/google/inject/internal/cglib/core/$ReflectUtils 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.cglib.reflect.$FastClassEmitter.(FastClassEmitter.java:67) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:72) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:216) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:64) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:207) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.DefaultConstructionProxyFactory.create(DefaultConstructionProxyFactory.java:53) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal.ProxyFactory.create(ProxyFactory.java:153) 03-05 00:57:35.568: E/AndroidRuntime(2295): at com.google.inject.internal 03-05 00:57:36.178: I/dalvikvm(2295): threadid=3: reacting to signal 3 03-05 00:57:36.188: I/dalvikvm(2295): Wrote stack traces to '/data/anr/traces.txt' 03-05 00:57:36.530: I/dalvikvm(2295): threadid=3: reacting to signal 3 03-05 00:57:36.538: I/dalvikvm(2295): Wrote stack traces to '/data/anr/traces.txt'
ねえ、解決策はありますか? –
私は1時間前に質問を掲示し、良いカップルのためにそれを攻撃していました...そうではありません。 –
ちょっとこれを見てくださいhttps://code.google.com/p/google-guice/wiki/OSGiこれは、関連するタイプがパッケージプライベートでない場合にのみ可能です(定義上、パッケージによってはプライベートタイプが他のクラスローダー)。 –