2016-05-09 6 views
1

Ich schaltete proguard in durch Anwendung habe ich eine Warnung in Anwendung onCreateProguard mit Roboguice

RoboGuice.injectMembers(_appContext, this); 

Die Ausnahme:

nalizableReferenceQueue﹕ 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. 
    java.io.FileNotFoundException: com/google/inject/internal/util/$Finalizer.class 
      at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.getBaseUrl(SourceFile:269) 
      at com.google.inject.internal.util.$FinalizableReferenceQueue$DecoupledLoader.loadFinalizer(SourceFile:253) 
      at com.google.inject.internal.util.$FinalizableReferenceQueue.loadFinalizer(SourceFile:175) 
      at com.google.inject.internal.util.$FinalizableReferenceQueue.<clinit>(SourceFile:100) 
      at com.google.inject.internal.util.$MapMaker$QueueHolder.<clinit>(SourceFile:787) 
      at com.google.inject.internal.util.$MapMaker$WeakEntry.<init>(SourceFile:946) 
      at com.google.inject.internal.util.$MapMaker$Strength$1.newEntry(SourceFile:312) 
      at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(SourceFile:498) 
      at com.google.inject.internal.util.$MapMaker$StrategyImpl.newEntry(SourceFile:419) 
      at com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(SourceFile:2029) 
      at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(SourceFile:116) 
      at com.google.inject.internal.Annotations.isBindingAnnotation(SourceFile:180) 
      at com.google.inject.Key.ensureIsBindingAnnotation(SourceFile:366) 
      at com.google.inject.Key.strategyFor(SourceFile:338) 
      at com.google.inject.Key.get(SourceFile:272) 
      at com.google.inject.internal.AbstractBindingBuilder.annotatedWithInternal(SourceFile:82) 
      at com.google.inject.internal.ConstantBindingBuilderImpl.annotatedWith(SourceFile:49) 
      at roboguice.config.DefaultRoboModule.configure(SourceFile:117) 
      at com.google.inject.AbstractModule.configure(SourceFile:59) 
      at com.google.inject.spi.Elements$RecordingBinder.install(SourceFile:223) 
      at com.google.inject.spi.Elements.getElements(SourceFile:101) 
      at com.google.inject.spi.Elements.getElements(SourceFile:78) 
      at roboguice.RoboGuice.setBaseApplicationInjector(SourceFile:83) 
      at roboguice.RoboGuice.setBaseApplicationInjector(SourceFile:139) 
      at roboguice.RoboGuice.getBaseApplicationInjector(SourceFile:59) 
      at roboguice.RoboGuice.getInjector(SourceFile:149) 
      at roboguice.RoboGuice.injectMembers(SourceFile:156) 
      at com.package.MyApplication.x(SourceFile:847) 
      at com.package.MyApplication.onCreate(SourceFile:243) 
      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013) 
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4712) 
      at android.app.ActivityThread.-wrap1(ActivityThread.java) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
      at android.os.Handler.dispatchMessage(Handler.java:102) 
      at android.os.Looper.loop(Looper.java:148) 
      at android.app.ActivityThread.main(ActivityThread.java:5422) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

ich in meiner proguard Datei enthalten:

-keep public class * extends android.app.Application 
-keep class com.google.inject.** { *; } 
-keep class javax.inject.** { *; } 
-keep class javax.annotation.** { *; } 
-keep class roboguice.** { *; } 

Was soll ich sonst tun?

Antwort

2

auf Ihre proguard Datei hinzufügen

-keep class com.google.inject.internal.util.$Finalizer { *; } 
+0

angehen noch nicht arbeiten – NickF

+0

@NickF sind Sie sicher, dass diese Proguard-Datei verwendet wird? –

+0

ja. Bedeutet die Reihenfolge der Aufbewahrung etwas? – NickF

2

Bitte fügen Sie die folgenden Zeilen in Ihre Datei ein, um Ihr Problem zu lösen.

 -keep class com.google.inject.Binder 
     -keepclassmembers class * { 
      @com.google.inject.Inject <init>(...); 
     } 

     # There's no way to keep all @Observes methods, so use the On*Event convention to identify event handlers 
     -keepclassmembers class * { 
      void *(**On*Event); 
     } 
     -keep public class * extends android.view.View { 
      public <init>(android.content.Context); 
      public <init>(android.content.Context, android.util.AttributeSet); 
      public <init>(android.content.Context, android.util.AttributeSet, int); 
      public void set*(...); 
     } 
     -keep public class roboguice.** 
     -keep class com.google.inject.internal.util.$Finalizer { *; } 

Dies ist nach dem offiziellen Dokument here

+0

noch nicht – NickF

+0

arbeiten kann u fallen mir alle progaurd Datei, die es EASSy sein –