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

内置插件调用Fragment,报错cannot be cast to android.support.v4.app.Fragment #467

Open
shuimuqinghua opened this issue Dec 27, 2017 · 3 comments

Comments

@shuimuqinghua
Copy link

shuimuqinghua commented Dec 27, 2017

问题详细描述 Detailed description of the problem

使用replugin-simple中的代码,直接跑能正常跳转到DemoCodeFragment。
然后,加入我自己写的personPlugin.jar,进行Fragment跳转,抛出异常。

复现问题步骤 Steps to reproduce the problem

  1. 打包personPlugin.jar放入assets
    image

  2. 修改PluginFragmentActivity中代码
    image

3.运行,跳转抛出异常。
image

其它重要信息 Other important information

replugin-host-lib/gradle Version:2.2.1
rePlugin-plugin-lib/gradle Version:2.2.1

Android API Version:
Android 手机型号&ROM(Phone model & ROM):

Logcat上下文 Logcat context

image

@zhmcoder
Copy link

zhmcoder commented Jan 4, 2018

可以在宿主中添加一个EmptyFragment类,把这个类打包成jar,再在插件中provider这个jar包,插件中的Fragment继承EmptyFragment,可以解决这个问题

@WalkerGH
Copy link

能在具体点吗 我现在是创建一个module,里面有个emptyfragment,把这个module打成jar包,provide给插件,还是显示ClassCastException。

@SkyEric
Copy link
Contributor

SkyEric commented Feb 13, 2018

具体可参照FAQ:https://github.com/Qihoo360/RePlugin/wiki/FAQ

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

4 participants