johncarl81 / transfuse

:syringe: Transfuse - A Dependency Injection and Integration framework for Google Android
http://androidtransfuse.org/
Apache License 2.0
220 stars 28 forks source link

Catch errored class intialization and use a direct class instead #183

Closed johncarl81 closed 9 years ago

johncarl81 commented 9 years ago

182

dbachelder commented 9 years ago

Now it's not finding the class

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.yahoo.mobile.client.android.util.rangeseekbar.RangeSeekBar
    at org.androidtransfuse.sun.codemodel.JCodeModel.ref(JCodeModel.java:378)
    at org.androidtransfuse.sun.codemodel.JCodeModel$TypeNameParser.parseTypeName(JCodeModel.java:472)
    at org.androidtransfuse.sun.codemodel.JCodeModel.parseType(JCodeModel.java:424)
    at org.androidtransfuse.gen.ClassGenerationUtil.type(ClassGenerationUtil.java:67)
    at org.androidtransfuse.gen.variableBuilder.FragmentViewVariableBuilder.inject(FragmentViewVariableBuilder.java:109)
    at org.androidtransfuse.gen.variableBuilder.FragmentViewVariableBuilder.buildExpression(FragmentViewVariableBuilder.java:98)
    at org.androidtransfuse.gen.variableBuilder.ConsistentTypeVariableBuilder.buildVariable(ConsistentTypeVariableBuilder.java:53)
    at org.androidtransfuse.gen.variableDecorator.VariableBuilderExpressionDecorator.buildVariableExpression(VariableBuilderExpressionDecorator.java:31)
    at org.androidtransfuse.gen.variableDecorator.VirtualProxyExpressionDecorator.buildVariableExpression(VirtualProxyExpressionDecorator.java:66)
    at org.androidtransfuse.gen.variableDecorator.ScopedExpressionDecorator.buildVariableExpression(ScopedExpressionDecorator.java:42)
    at org.androidtransfuse.gen.variableDecorator.CachedExpressionDecorator.buildVariableExpression(CachedExpressionDecorator.java:40)
    at org.androidtransfuse.gen.InjectionExpressionBuilder.buildVariable(InjectionExpressionBuilder.java:35)
    at org.androidtransfuse.gen.InjectionExpressionBuilder.setupInjectionRequirements(InjectionExpressionBuilder.java:50)
    at org.androidtransfuse.gen.variableBuilder.VariableInjectionBuilder.buildVariable(VariableInjectionBuilder.java:78)
    at org.androidtransfuse.gen.variableDecorator.VariableBuilderExpressionDecorator.buildVariableExpression(VariableBuilderExpressionDecorator.java:31)
    at org.androidtransfuse.gen.variableDecorator.VirtualProxyExpressionDecorator.buildVariableExpression(VirtualProxyExpressionDecorator.java:66)
    at org.androidtransfuse.gen.variableDecorator.ScopedExpressionDecorator.buildVariableExpression(ScopedExpressionDecorator.java:42)
    at org.androidtransfuse.gen.variableDecorator.CachedExpressionDecorator.buildVariableExpression(CachedExpressionDecorator.java:40)
    at org.androidtransfuse.gen.InjectionExpressionBuilder.buildVariable(InjectionExpressionBuilder.java:35)
    at org.androidtransfuse.gen.InjectionFragmentGenerator.buildFragment(InjectionFragmentGenerator.java:57)
    at org.androidtransfuse.experiment.generators.OnCreateInjectionGenerator$1.generate(OnCreateInjectionGenerator.java:100)
johncarl81 commented 9 years ago

Not terribly excited about catching that exception as well... seems like a bandaid on CodeModel. I'll have to think on a better way to handle this, but for now this should work. Mind trying again?

dbachelder commented 9 years ago

:+1: works for us!