Egret社区
疑问,Android原生包是不能直接使用外部游戏链接么?if (!nativeAndroid.initialize("https://yottacdn.akamaized.net/xuemeih5res/index_wei_md5.html?game_back_url=xuemeih5back.xunmenginc.com")) {
    Toast.makeText(this, "Initialize native failed.",
            Toast.LENGTH_LONG).show();
    return;
}然后删掉了assets/game目录,打包后手机运行崩溃链接是经发布的h5游戏链接,游戏的引擎版本是5.0.7,改动较多,不好升级。下面是Android studio的报错打印[size=15.0667px]2020-06-24 22:47:21.686 16381-16381/? E/MainActivity: Get @onState: {"state":"starting"}2020-06-24 22:47:21.707 16381-16381/? E/MainActivity: Get @onState: {"state":"running"}2020-06-24 22:47:23.079 16381-16397/? A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 16397 (GLThread 2230), pid 16381 (mes.moemoegirls)2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: Build fingerprint: 'KDDI/SOV36_jp_kdi/SOV36:9/47.2.C.1.126/1632396770:user/release-keys'2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: Revision: '0'2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: ABI: 'arm'2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: pid: 16381, tid: 16397, name: GLThread 2230  >>> com.carolgames.moemoegirls <<<2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x02020-06-24 22:47:23.182 16430-16430/? A/DEBUG: Cause: null pointer dereference2020-06-24 22:47:23.182 16430-16430/? A/DEBUG: Abort message: '2:ALWAYS:EgretRuntimeVersion:1.0.4(d6687402) armeabi-v7a'2020-06-24 22:47:23.182 16430-16430/? A/DEBUG:     r0  00000000  r1  00000000  r2  00000010  r3  000000002020-06-24 22:47:23.182 16430-16430/? A/DEBUG:     r4  c787e2b8  r5  00000000  r6  c8bcfd70  r7  c787e3102020-06-24 22:47:23.182 16430-16430/? A/DEBUG:     r8  00000006  r9  c787e2b8  r10 00000000  r11 000004052020-06-24 22:47:23.182 16430-16430/? A/DEBUG:     ip  c99e14ac  sp  c787e2b8  lr  c907aa4d  pc  e626ff3c2020-06-24 22:47:23.188 16430-16430/? A/DEBUG: backtrace:2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #00 pc 0001af3c  /system/lib/libc.so (strlen+72)2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #01 pc 0013aa49  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #02 pc 00168413  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #03 pc 000c9dc3  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #04 pc 004c8d9f  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #05 pc 004e97bb  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #06 pc 004e9239  /data/app/com.carolgames.moemoegirls-yamdHwsTl790jiblniJwFw==/lib/arm/libegret.so2020-06-24 22:47:23.188 16430-16430/? A/DEBUG:     #07 pc 0000055a  <anonymous:2b386000>2020-06-24 22:47:23.444 16430-16430/? E/crash_dump32: AM data write success!!: No such file or directory2020-06-24 22:47:23.460 16430-16430/? E/crash_dump32: Couldn't convert crashlevel: No such file or directory2020-06-24 22:47:23.460 16430-16430/? E/crash_dump32: Normal dump:com.carolgames.moemoegirls2020-06-24 22:47:23.469 1388-1388/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_042020-06-24 22:47:23.477 1267-1379/? E/nativedumper:FW:  parser.c(74): Failed to find expected node from: //mem_desc[@path]2020-06-24 22:47:23.482 1008-1008/? E/lowmemorykiller: Error writing /proc/16381/oom_score_adj; errno=222020-06-24 22:47:23.492 1267-1379/? E/nativedumper:FW:  utils.c(263): mkdir (/data/crashdata) failed. File exists2020-06-24 22:47:23.493 1267-1379/? E/nativedumper:FW:  ramdump_framework.c(361): fp is NULL2020-06-24 22:47:23.493 1267-1379/? E/nativedumper:FW:  ramdump_framework.c(542): Read-only file system2020-06-24 22:47:23.630 1177-1990/? E/InputDispatcher: channel '47b05af com.carolgames.moemoegirls/com.carolgames.moemoegirls.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!2020-06-24 22:47:23.945 1177-1543/? E/ActivityManager: Sending non-protected broadcast com.sonymobile.crashmonitorsystemservice.DIR_UPDATED from system 1177:system/1000 pkg android    java.lang.Throwable        at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:21882)        at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:22491)        at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22633)        at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1224)        at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1196)        at android.content.ContextWrapper.sendBroadcastAsUser(ContextWrapper.java:525)        at com.sonymobile.crashmonitor.system.service.DumpfileObserver.onEvent(DumpfileObserver.java:32)        at android.os.FileObserver$ObserverThread.onEvent(FileObserver.java:123)        at android.os.FileObserver$ObserverThread.observe(Native Method)        at android.os.FileObserver$ObserverThread.run(FileObserver.java:86)2020-06-24 22:47:24.901 1177-4248/? E/ActivityManager: Sending non-protected broadcast com.sonymobile.crashmonitor.CRASH_STATUS from system 16308:com.sonyericsson.crashmonitor/1000 pkg com.sonyericsson.crashmonitor    java.lang.Throwable        at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:21882)        at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:22491)        at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:22633)        at android.app.IActivityManager$Stub.onTransact$broadcastIntent$(IActivityManager.java:10169)        at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:167)        at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3422)        at android.os.Binder.execTransact(Binder.java:731)

分享到 :
0 人收藏

3 个回复

倒序浏览
app小王子  社区管理员 | 2020-6-28 12:00:17
引擎版本必须升级到5.1.6以上才可以哦
sfyuan  初学乍练 | 2020-6-28 12:22:42
app小王子 发表于 2020-6-28 12:00
引擎版本必须升级到5.1.6以上才可以哦


文档是下面这么写的
解决方案
通过launcher创建引擎版本为5.1.6或以上的egret工程,创建原生工程。
将需要打包原生应用的游戏发布为h5版本。
将发布结果替换到原生工程的assets/game目录下。

创建Android工程的项目的时候是用的5.2.33版本的空项目,然后按照文档删掉了assets/game目录,
url使用的是5.0.7版本的游戏链接。
意思是这里用到5.1.6以下的游戏链接,就必须把整个游戏都放到assets/game目录下面么?
sfyuan  初学乍练 | 2020-6-28 12:26:39
app小王子 发表于 2020-6-28 12:00
引擎版本必须升级到5.1.6以上才可以哦

那现状是我传入的url,游戏是在5.0.7魔改版本下开发的,Android native项目是5.2.33项目生成的,这样能用native打包么。h5游戏也不可能把所有资源都放到包内的
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

sfyuan

初学乍练

积分: 5 帖子: 7 精华: 0

楼主热帖

小黑屋|京网文[2014]0791-191号|京ICP证150115号|Egret社区 ( 京ICP备14025619号 )

Powered by Discuz! X3.4 © 2001-2019 Comsenz Inc.

返回顶部