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

Pixel 3 XL机型出现崩溃,com.just.agentweb.AgentActionFragment cannot be cast to android.app.Activity #967

Open
4 tasks done
fuhaodev opened this issue Jan 15, 2022 · 2 comments

Comments

@fuhaodev
Copy link

fuhaodev commented Jan 15, 2022

运行环境

  • 设备型号:Pixel 3 XL
  • 设备系统版本:Android 9
  • Gradle 版本:7.0.2
  • AgentWeb 版本:v5.0.0-alpha.1-androidx

具体问题描述

在该机型下出现Crash,应该源码中manifest文件中activity的name定义成fragment的问题,出现类型装换异常

<activity
            android:name="com.just.agentweb.AgentActionFragment"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:exported="false"
            android:launchMode="standard"
            android:theme="@style/actionActivity"
            android:windowSoftInputMode="stateHidden|stateAlwaysHidden" >
        </activity>

异常日志(堆栈)

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.exemple.demo/com.just.agentweb.AgentActionFragment}: java.lang.ClassCastException: com.just.agentweb.AgentActionFragment cannot be cast to android.app.Activity
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2881)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6718)
	at java.lang.reflect.Method.invoke(Method.java)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassCastException: com.just.agentweb.AgentActionFragment cannot be cast to android.app.Activity
	at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
	at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:0)
	at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
	at EdHooker_.hook(EdHooker_.java:150)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2869)
	... 11 more
Back traces ends.
@tiamosu
Copy link

tiamosu commented Oct 9, 2022

出现同上问题,版本v5.0.6-androidx

@JellyBrother
Copy link

出现同上问题,版本v5.0.6-androidx,出现同上问题,版本v5.0.5-androidx,出现同上问题,版本v5.0.4-androidx,出现同上问题,版本v5.0.0-androidx。4.1.9虽然可以,但是远程仓库连接不上。

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