2***@qq.com
2***@qq.com
  • 发布:2019-06-04 16:02
  • 更新:2019-07-12 11:31
  • 阅读:3085

H5页面调用原生activity

分类:HTML5+

原生的项目页面调用了第三方控件,并且访问页面都正常。现在将H5嵌入原生后,apk入口访问H5页面,从H5页面点击菜单调用原生activity,没有第三方控件的页面可以打开,有第三方控件的页面打开应用白屏闪退。

调用原生activity代码如下:
var activity = plus.android.runtimeMainActivity();
var Intent = plus.android.importClass("android.content.Intent");
var intent = new Intent(activity.getIntent());
intent.setClassName(activity, "com.mm.dss.demo.LoginActivity");
activity.startActivity(intent);

报错页面布局如下图:

报错信息如下:
D/PullToRefresh: isLastItemVisible. Last Item Position: 61 Last Visible Pos: 11
D/PullToRefresh: First Visible: 0. Visible Count: 12. Total Items:62
D/26499DeviceFragment: channel onItemClick position: 5
V/libnb: enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevelILjava_lang_String_2, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel__ILjava_lang_String_2, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel
ILjava_lang_String_2, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevelILjava_lang_String_2, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel__ILjava_lang_String_2, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel, trampoline_addr 0x0
enter native_bridge2_getTrampoline Java_com_lechange_common_log_Logger_setLogLevel
ILjava_lang_String_2, trampoline_addr 0x0
E/art: No implementation found for void com.lechange.common.log.Logger.setLogLevel(int, java.lang.String) (tried Java_com_lechange_common_log_Logger_setLogLevel and Java_com_lechange_common_log_Logger_setLogLevel__ILjava_lang_String_2)
D/AndroidRuntime: Shutting down VM
W/System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mm.dss.demo/com.mm.dss.demo.PlayOnlineActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class com.mm.uc.PlayWindow
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
W/System.err: Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.mm.uc.PlayWindow
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.mm.dss.demo.PlayOnlineActivity.onCreate(PlayOnlineActivity.java:128)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
... 21 more
Caused by: java.lang.UnsatisfiedLinkError: No implementation found for void com.lechange.common.log.Logger.setLogLevel(int, java.lang.String) (tried Java_com_lechange_common_log_Logger_setLogLevel and Java_com_lechange_common_log_Logger_setLogLevel__ILjava_lang_String_2)
at com.lechange.common.log.Logger.setLogLevel(Native Method)
at com.mm.Api.PlayWindowManager.<init>(PlayWindowManager.java:102)
at com.mm.uc.PlayWindow.initVideoWindow(PlayWindow.java:552)
at com.mm.uc.PlayWindow.<init>(PlayWindow.java:52)
... 24 more
java.lang.Exception: denglibo killProcess callstack! pid=10707
at android.os.Process.killProcess(Process.java:1026)
at io.dcloud.common.adapter.util.UEH$1.uncaughtException(UEH.java:60)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
I/Process: Sending signal. PID: 10707 SIG: 9
Application terminated.

2019-06-04 16:02 负责人:无 分享
已邀请:
zopen

zopen

private static void loadLibrary(){
System.loadLibrary("gnustl_shared");
System.loadLibrary("dsl");
System.loadLibrary("dslalien");
System.loadLibrary("DPRTSPSDK");
System.loadLibrary("PlatformRestSDK");
System.loadLibrary("PlatformSDK");
System.loadLibrary("netsdk");
System.loadLibrary("CommonSDK");
}
这些系统文件没加载

该问题目前已经被锁定, 无法添加新回复