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

主host跳转到插件 报ActivityNotFoundException 没找到 #1077

Open
ningzha opened this issue Sep 20, 2024 · 4 comments
Open

主host跳转到插件 报ActivityNotFoundException 没找到 #1077

ningzha opened this issue Sep 20, 2024 · 4 comments

Comments

@ningzha
Copy link

ningzha commented Sep 20, 2024

问题详细描述 Detailed description of the problem

配置好横屏坑位后,

  1. 从主Host跳转到插件里面ActivityA,ActivityA再跳转到ActivityB,在ActivityB点返回的时候,会直接跳转到主Host,ActivityA被销毁了,应该是点B返回到A;
  2. 有时候会报Activity没找到

复现问题步骤 Steps to reproduce the problem

其它重要信息 Other important information

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

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

Logcat上下文 Logcat context

CD58D099-2682-4883-A094-3E6D5529F5D2
91BC4B50-8E68-44E0-91EB-F190694B95D1

@lichao3140
Copy link

您好,请问你这个问题解决了吗?我也遇到类似的,Host跳转到插件Activity就报错,到了加载R.文件就报错,Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0c002d
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:299)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2390)
at android.content.res.Resources.getLayout(Resources.java:1341)
at android.view.LayoutInflater.inflate(LayoutInflater.java:421)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:498)
at com.android.internal.policy.HwPhoneWindow.setContentView(HwPhoneWindow.java:344)
at android.app.Activity.setContentView(Activity.java:2941)
at androidx.activity.ComponentActivity.setContentView(ComponentActivity.java:440)
at com.hjl.testplugin.ui.activity.MainActivity.onCreate(MainActivity.kt:11)
at android.app.Activity.performCreate(Activity.java:7458)
at android.app.Activity.performCreate(Activity.java:7448)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3533)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3738) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) 
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:2226) 
at android.os.Handler.dispatchMessage(Handler.java:112) 
at android.os.Looper.loop(Looper.java:216) 
at android.app.ActivityThread.main(ActivityThread.java:7779) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:990) 

@ningzha
Copy link
Author

ningzha commented Sep 29, 2024

您好,请问你这个问题解决了吗?我也遇到类似的,Host跳转到插件Activity就报错,到了加载R.文件就报错,Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f0c002d at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:299) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2390) at android.content.res.Resources.getLayout(Resources.java:1341) at android.view.LayoutInflater.inflate(LayoutInflater.java:421) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:498) at com.android.internal.policy.HwPhoneWindow.setContentView(HwPhoneWindow.java:344) at android.app.Activity.setContentView(Activity.java:2941) at androidx.activity.ComponentActivity.setContentView(ComponentActivity.java:440) at com.hjl.testplugin.ui.activity.MainActivity.onCreate(MainActivity.kt:11) at android.app.Activity.performCreate(Activity.java:7458) at android.app.Activity.performCreate(Activity.java:7448) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3533) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3738)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)  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:2226)  at android.os.Handler.dispatchMessage(Handler.java:112)  at android.os.Looper.loop(Looper.java:216)  at android.app.ActivityThread.main(ActivityThread.java:7779)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:990)

没有解决,咱俩报的错不是一个问题吧,你看看你那个gradle版本对吗

@lichao3140
Copy link

gradle应该是没问题,你的版本是多少?我把R文件不加载,布局用compose或者代码写一个控件,host是可以正常打开插件app的,不会报R文件找不到

@renjinlong
Copy link
Collaborator

1.目前的高版本Gradle,只适配了
Gradle:7.5
AGP:7.4.2
2.如果开启横屏坑位,默认只配置了一个,可以增加横屏的坑位数试一下
countTranslucentStandardLand = 5
countTranslucentSingleTopLand = 5
countTranslucentSingleTaskLand = 5
countNotTranslucentStandardLand = 5
countNotTranslucentSingleTopLand = 5
countNotTranslucentSingleTaskLand = 5
countNotTranslucentSingleInstanceLand = 5

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