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

java.lang.ClassCastException: com.antfortune.freeline.FreelineApplication cannot be cast to #159

Closed
wunianhub opened this issue Sep 22, 2016 · 3 comments
Assignees

Comments

@wunianhub
Copy link

自定义的一个AppContext 继承于MultiDexApplication,然后调用((AppContext) getApplicationContext()) 在升级0.7.0后就报了这个异常,在0.6.3没问题。 #

@lomanyong
Copy link
Member

lomanyong commented Sep 22, 2016

@wunianhub 快速的解决方案,添加配置项:

freeline {
    applicationProxy false
}

@hzy82218052
Copy link

同样有这个问题,加入applicationProxy false后解决问题

@lomanyong lomanyong added the bug label Sep 26, 2016
@lomanyong lomanyong self-assigned this Sep 26, 2016
@lomanyong lomanyong added wontfix and removed bug labels Sep 28, 2016
@lomanyong
Copy link
Member

lomanyong commented Sep 28, 2016

排查了一下这个问题,跟项目自定义的关系比较大,没有办法彻底地根治。最好的办法就是解除applicationProxy,手动添加FreelineCore.init(this);到对应的Application类中,类似:

Gradle配置:

freeline {
    ....
    applicationProxy false
}

Application类:

public class YourApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        FreelineCore.init(this);
    }
}

修改完之后依次执行:

gradlew clean
python freeline.py

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