FragmentRigger
FragmentRigger copied to clipboard
项目代码里加入FragmentRigger程序出现崩溃的问题
使用FragmentRigger运行出现如下错误 1:UnKnown error com.lig.MainActivity@3c20f16d is not added into rigger. please check your config or contact author. 2:Caused by: com.jkb.fragment.rigger.exception.RiggerException: UnKnown error com.poct.edan.cl30.MainActivity@3c20f16d is not added into rigger. please check your config or contact author.
出错的位置在如下函数,因为rigger为 null public static IRigger getRigger(Object puppet) { if(!(puppet instanceof AppCompatActivity) && !(puppet instanceof Fragment)) { throw new RiggerException("Puppet Annotation class can only used on android.app.Activity or android.support.v4.app.Fragment"); } else { Class<?> clazz = puppet.getClass(); Puppet puppetAnnotation = (Puppet)clazz.getAnnotation(Puppet.class); if(puppetAnnotation == null) { throw new RiggerException("Can not find Puppet annotation.please add Puppet annotation for the class " + puppet.getClass().getName()); } else { int code = System.identityHashCode(puppet); IRigger rigger = (IRigger)getInstance().mPuppetMap.get(Integer.valueOf(code)); if(rigger == null) { throw new RiggerException("UnKnown error " + puppet + " is not added into rigger. please check your config or contact author."); } else { return rigger; } } } }
找了一天了,没有找到原因,FragmentRigger的使用方法没有问题,请各位支招
@lig0621 请检查 MainActivity 是否添加 @Puppet 注解呢
请问解决了吗?我也遇到同样问题,MainActivity有添加puppet注释
- MainActivity 注释 @Puppet(containerViewId = R.id.content_fl, stickyStack = true) public class MainActivity extends AppCompatActivity implements View.OnClickListener