Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目代码里加入FragmentRigger程序出现崩溃的问题 #95

Open
lig0621 opened this issue Nov 10, 2020 · 2 comments
Open

项目代码里加入FragmentRigger程序出现崩溃的问题 #95

lig0621 opened this issue Nov 10, 2020 · 2 comments

Comments

@lig0621
Copy link

lig0621 commented Nov 10, 2020

使用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的使用方法没有问题,请各位支招

@JingYeoh
Copy link
Owner

@lig0621 请检查 MainActivity 是否添加 @puppet 注解呢

@sanluku
Copy link

sanluku commented Mar 13, 2022

请问解决了吗?我也遇到同样问题,MainActivity有添加puppet注释

  1. MainActivity 注释
    @puppet(containerViewId = R.id.content_fl, stickyStack = true)
    public class MainActivity extends AppCompatActivity implements View.OnClickListener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants