2***@qq.com
2***@qq.com
  • 发布:2026-05-12 15:01
  • 更新:2026-05-12 15:02
  • 阅读:21

【报Bug】uniapp打包放到android studio中长时间运行,会崩溃报错,并且冻屏

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号:

HBuilderX类型: 正式

HBuilderX版本号: 5.05

手机系统: Android

手机系统版本号: Android 7.1.1

手机厂商: 捷宇

手机机型:

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

示例代码:

/**

  • 客户端运行日志:App 端按日期写入系统「下载」目录根下的 .jsonl 文件(便于 U 盘/MTP/文件管理器查看),
  • 仅保留最近 LOG_RETAIN_DAYS 个自然日文件并自动删除更早的。
  • 可选内网 POST 批量上报(使用内存缓冲,与文件写入并行)。
    */

import {
LOG_CLIENT_RECORD_ENABLED,
LOG_REPORT_URL,
LOG_DEBUG_CONSOLE,
LOG_FILE_NAME_PREFIX,
LOG_RETAIN_DAYS
} from '@/utils/const.js'

const LEGACY_QUEUE_KEY = 'client_run_log_q_v1'
const MAX_TEXT = 6000
/* 单条日志里请求体 / 响应体各自最大字符数(JSON 字符串化后截断) /
const MAX_HTTP_BODY_CHARS = 14000
const UPLOAD_BUFFER_MAX = 120

let uploadBuffer = []
let flushing = false
let writeChain = Promise.resolve()
let pruneTimer = null

function now() {
return Date.now()
}

function rid() {
return ${now()}_${Math.random().toString(36).slice(2, 11)}
}

function safeJson(obj) {
try {
return JSON.stringify(obj)
} catch (e) {
return '"[unserializable]"'
}
}

function truncateText(s) {
if (s == null) return ''
const str = typeof s === 'string' ? s : safeJson(s)
if (str.length <= MAX_TEXT) return str
return str.slice(0, MAX_TEXT) + '…(truncated)'
}

const SENSITIVE_KEYS = new Set(
['password', 'token', 'oldpassword', 'newpassword', 'authorization', 'secret', 'accesstoken', 'refreshtoken']
)

function sanitize(obj, depth) {
if (depth > 6) return '[depth]'
if (obj == null) return obj
const t = typeof obj
if (t !== 'object') return obj
if (Array.isArray(obj)) return obj.map((x) => sanitize(x, depth + 1))
const out = {}
Object.keys(obj).forEach((k) => {
if (SENSITIVE_KEYS.has(String(k).toLowerCase())) {
out[k] = '[redacted]'
} else {
out[k] = sanitize(obj[k], depth + 1)
}
})
return out
}

function systemCtx() {
try {
const s = uni.getSystemInfoSync() || {}
return {
platform: s.platform,
system: s.system,
model: s.model,
uniPlatform: s.uniPlatform,
appName: s.appName,
appVersion: s.appVersion,
appVersionCode: s.appVersionCode
}
} catch (e) {
return {}
}
}

function formatLogDate(ts) {
const d = new Date(ts)
const y = d.getFullYear()
const m = String(d.getMonth() + 1).padStart(2, '0')
const day = String(d.getDate()).padStart(2, '0')
return ${y}-${m}-${day}
}

/* 日志用本地可读时间(非 UTC),格式 2026-03-01 12:59:30 /
export function formatDateTime(ts) {
const d = new Date(ts)
const p = (n) => String(n).padStart(2, '0')
return ${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}
}

/**

  • 用于写入日志的请求/响应快照:脱敏 + 控制体积
  • @returns {unknown}
    */
    function snapshotForLog(value) {
    if (value === undefined) {
    return undefined
    }
    if (value === null) {
    return null
    }
    let v = value
    if (typeof v === 'object') {
    try {
    v = sanitize(v)
    } catch (e) {
    return {
    _logError: String(e)
    }
    }
    }
    const s = safeJson(v)
    if (s.length <= MAX_HTTP_BODY_CHARS) {
    return v
    }
    return {
    _logTruncated: true,
    approxChars: s.length,
    preview: s.slice(0, MAX_HTTP_BODY_CHARS)
    }
    }

function logFilePattern() {
return new RegExp(
^${LOG_FILE_NAME_PREFIX.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}_(\\d{4}-\\d{2}-\\d{2})\\.jsonl$
)
}

function startOfDayFromYmd(y, m, d) {
const x = new Date(y, m - 1, d)
x.setHours(0, 0, 0, 0)
return x.getTime()
}

function oldestKeptFileMidnight() {
const t = new Date()
t.setHours(0, 0, 0, 0)
t.setDate(t.getDate() - (LOG_RETAIN_DAYS - 1))
return t.getTime()
}

function isPlusFile() {
return typeof plus !== 'undefined' && plus.io
}

function requestAndroidWriteOnce() {
return new Promise((resolve) => {
if (!isPlusFile() || plus.os.name !== 'Android') {
resolve(true)
return
}
try {
const Build = plus.android.importClass('android.os.Build')
if (Build.VERSION.SDK_INT < 23) {
resolve(true)
return
}
const main = plus.android.runtimeMainActivity()
const PackageManager = plus.android.importClass('android.content.pm.PackageManager')
const perm = 'android.permission.WRITE_EXTERNAL_STORAGE'
if (main.checkSelfPermission(perm) === PackageManager.PERMISSION_GRANTED) {
resolve(true)
return
}
plus.android.requestPermissions(
[perm],
(e) => {
const ok = e && e.granted && e.granted.indexOf(perm) >= 0
resolve(!!ok)
},
() => resolve(false)
)
} catch (e) {
resolve(true)
}
})
}

let androidPermChain = null

function ensureAndroidWritePerm() {
if (!isPlusFile() || plus.os.name !== 'Android') {
return Promise.resolve(true)
}
if (!androidPermChain) {
androidPermChain = requestAndroidWriteOnce()
}
return androidPermChain
}

function resolveDownloadsDirEntry() {
return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL(
'_downloads/',
(entry) => resolve(entry),
() => {
plus.io.requestFileSystem(
plus.io.PUBLIC_DOWNLOADS,
(fs) => {
resolve(fs.root)
},
(e) => reject(e || new Error('PUBLIC_DOWNLOADS fail'))
)
}
)
})
}

function readDirAllEntries(dirEntry) {
return new Promise((resolve, reject) => {
const reader = dirEntry.createReader()
const all = []

    function readBatch() {  
        reader.readEntries(  
            (entries) => {  
                if (!entries || !entries.length) {  
                    resolve(all)  
                    return  
                }  
                all.push(...entries)  
                readBatch()  
            },  
            (e) => reject(e)  
        )  
    }  

    readBatch()  
})  

}

function readFileEntryAsText(fileEntry) {
return new Promise((resolve, reject) => {
fileEntry.file(
(file) => {
try {
const fr = new plus.io.FileReader()
fr.onloadend = (evt) => {
const r = evt.target.result
resolve(typeof r === 'string' ? r : '')
}
fr.onerror = () => resolve('')
fr.readAsText(file)
} catch (e) {
resolve('')
}
},
() => resolve('')
)
})
}

/* 序列化时把 timeText 放最前,便于直接打开文件看到访问时间 /
function rowToOrderedJson(row) {
if (row && row._compact === true) {
return safeJson({
timeText: row.timeText,
status: row.status,
requestType: row.requestType,
requestData: row.requestData,
responseData: row.responseData
})
}
const {
timeText,
ts,
id,
ctx,
...rest
} = row
return safeJson(
Object.assign({
timeText,
ts,
id
},
rest, {
ctx
}
)
)
}

function emitRow(row) {
addToUploadBuffer(row)
if (LOG_DEBUG_CONSOLE && typeof console !== 'undefined' && console.log) {
console.log('[client-log]', row.level || row.status || '', row.type || row.requestType || '', row.message || '')
}
if (isPlusFile()) {
queueFileAppend(row)
}
tryFlushSoon()
}

function appendLineToDateFile(row, dateStr) {
return new Promise((resolve, reject) => {
const name = ${LOG_FILE_NAME_PREFIX}_${dateStr}.jsonl
const line = rowToOrderedJson(row) + '\n'
resolveDownloadsDirEntry()
.then((dirEntry) => {
dirEntry.getFile(
name, {
create: true
},
(fe) => {
fe.file(
(file) => {
const size = file.size || 0
fe.createWriter(
(writer) => {
writer.onerror = (e) => reject(e)
writer.onwrite = () => {
schedulePruneOldFiles(dirEntry)
resolve()
}
writer.seek(size)
writer.write(line)
},
(e) => reject(e)
)
},
(e) => reject(e)
)
},
(e) => reject(e)
)
})
.catch(reject)
})
}

function schedulePruneOldFiles(dirEntry) {
if (pruneTimer) clearTimeout(pruneTimer)
pruneTimer = setTimeout(() => {
pruneTimer = null
pruneOldLogFiles(dirEntry).catch(() => {})
}, 1500)
}

function pruneOldLogFiles(dirEntry) {
const pat = logFilePattern()
const cutoff = oldestKeptFileMidnight()
return readDirAllEntries(dirEntry).then((entries) => {
const tasks = []
entries.forEach((entry) => {
if (!entry.isFile) return
const m = entry.name.match(pat)
if (!m) return
const [_, ymd] = m
const p = ymd.split('-').map(Number)
const fileMid = startOfDayFromYmd(p[0], p[1], p[2])
if (fileMid < cutoff) {
tasks.push(
new Promise((res) => {
entry.remove(res, res)
})
)
}
})
return Promise.all(tasks)
})
}

function queueFileAppend(row) {
const safeTs = Number.isFinite(row && row.ts) ? row.ts : now()
const dateStr = formatLogDate(safeTs)
writeChain = writeChain
.then(() => ensureAndroidWritePerm())
.then(() => appendLineToDateFile(row, dateStr))
.catch((e) => {
if (LOG_DEBUG_CONSOLE && typeof console !== 'undefined' && console.error) {
console.error('[logger] file append failed', e)
}
})
return writeChain
}

function addToUploadBuffer(row) {
if (!LOG_REPORT_URL || !LOG_CLIENT_RECORD_ENABLED) return
uploadBuffer.push(row)
if (uploadBuffer.length > UPLOAD_BUFFER_MAX) {
uploadBuffer = uploadBuffer.slice(-UPLOAD_BUFFER_MAX)
}
}

function enqueue(entry) {
if (!LOG_CLIENT_RECORD_ENABLED) return
const ts = now()
const timeText = formatDateTime(ts)
const withTimePrefix = (text) => {
if (text == null || text === '') {
return timeText
}
const s = String(text)
if (s.startsWith(timeText)) {
return s
}
return ${timeText} ${s}
}
const row = {
...entry,
timeText,
ts,
id: rid(),
message: withTimePrefix(entry.message),
ctx: systemCtx()
}
emitRow(row)
}

function tryFlushSoon() {
if (!LOG_CLIENT_RECORD_ENABLED || !LOG_REPORT_URL || flushing) return
setTimeout(() => {
flushLogs()
}, 50)
}

function migrateRemoveLegacyStorage() {
try {
uni.removeStorageSync(LEGACY_QUEUE_KEY)
} catch (e) {}
}

export function initLogger() {
migrateRemoveLegacyStorage()
setInterval(() => {
flushLogs()
}, 20000)
setInterval(() => {
if (!isPlusFile()) return
resolveDownloadsDirEntry()
.then((dir) => pruneOldLogFiles(dir))
.catch(() => {})
}, 6 60 60 * 1000)
}

export function flushLogs() {
if (!LOG_CLIENT_RECORD_ENABLED || !LOG_REPORT_URL || flushing) return
if (!uploadBuffer.length) return
flushing = true
const batch = uploadBuffer.slice(0, 25)
uni.request({
url: LOG_REPORT_URL,
method: 'POST',
header: {
'content-type': 'application/json;charset=utf-8'
},
data: {
logs: batch
},
success: (res) => {
const ok = res.statusCode >= 200 && res.statusCode < 300
if (!ok) return
uploadBuffer = uploadBuffer.slice(batch.length)
},
complete: () => {
flushing = false
}
})
}

export function logHttp(payload) {
const {
kind,
method,
path,
url,
durationMs,
requestData,
requestHeaders,
responseData,
statusCode,
bizCode,
error
} = payload
const errBrief =
error && (error.errMsg || error.message) ?
error.errMsg || error.message :
error ?
String(error) :
undefined
const api = ${method} ${path}
const timeText = formatDateTime(now())
let responseSnap
if (kind === 'network_error') {
responseSnap = snapshotForLog(
sanitize({
httpStatusCode: statusCode,
errMsg: errBrief,
err: error && typeof error === 'object' ? sanitize(error) : error
})
)
} else {
responseSnap = snapshotForLog(responseData)
}
const requestSnap = snapshotForLog(requestData)
const statusText = ${kind}(http:${statusCode != null ? statusCode : '-'},biz:${bizCode != null ? bizCode : '-'})
const ts = now()
emitRow({
_compact: true,
timeText,
ts,
status: statusText,
requestType: api,
requestData: requestSnap,
responseData: responseSnap
})
}

export function logVueError(err, info) {
const msg = err && err.message ? err.message : String(err)
const stack = err && err.stack ? err.stack : ''
enqueue({
level: 'error',
type: 'vue',
message: msg,
detail: truncateText(
safeJson(
sanitize({
info: info || '',
stack
})
)
)
})
}

export function logAppScriptError(msg) {
enqueue({
level: 'error',
type: 'app_onError',
message: typeof msg === 'string' ? msg : safeJson(msg),
detail: ''
})
}

export function logUnhandled(source, reason) {
const text =
reason && typeof reason === 'object' && reason.message ?
reason.message :
String(reason)
const stack = reason && reason.stack ? reason.stack : ''
enqueue({
level: 'error',
type: 'unhandled',
message: ${source}: ${text},
detail: truncateText(stack || safeJson(reason))
})
}

export function installUnhandledRejection() {
// #ifdef H5
if (typeof window !== 'undefined' && window.addEventListener) {
window.addEventListener('unhandledrejection', (e) => {
logUnhandled('unhandledrejection', e.reason)
})
}
// #endif
// #ifdef APP-PLUS
if (typeof globalThis !== 'undefined' && typeof globalThis.addEventListener === 'function') {
globalThis.addEventListener('unhandledrejection', (e) => {
logUnhandled('unhandledrejection', e.reason)
})
}
// #endif
if (typeof uni !== 'undefined' && typeof uni.onUnhandledRejection === 'function') {
uni.onUnhandledRejection((res) => {
logUnhandled('uni.onUnhandledRejection', res.reason)
})
}
}

/* 等待当前排队中的文件写入完成(再执行复制等) /
export function waitLogWritesDone() {
return writeChain.then(() => undefined)
}

/* 兼容旧名:与 waitLogWritesDone 相同 /
export function persistClientLogsNow() {
return waitLogWritesDone()
}

/**

  • 从下载目录读取所有匹配前缀的日志文件,合并为行对象(顺序不保证严格按时间)。
  • 非 App 端无文件时返回内存中待上报缓冲。
    */
    export function getClientLogQueue() {
    if (!isPlusFile()) {
    return Promise.resolve([...uploadBuffer])
    }
    return waitLogWritesDone().then(() =>
    resolveDownloadsDirEntry()
    .then((dirEntry) => readDirAllEntries(dirEntry))
    .then((entries) => {
    const pat = logFilePattern()
    const files = entries.filter((e) => e.isFile && pat.test(e.name))
    files.sort((a, b) => a.name.localeCompare(b.name))
    return Promise.all(files.map((fe) => readFileEntryAsText(fe))).then((texts) => {
    const rows = []
    texts.forEach((t) => {
    const lines = (t || '').split('\n')
    lines.forEach((line) => {
    const s = line.trim()
    if (!s) return
    try {
    rows.push(JSON.parse(s))
    } catch (e) {}
    })
    })
    return rows
    })
    })
    .catch(() => [...uploadBuffer])
    )
    }

export function copyClientLogsToClipboard() {
return getClientLogQueue().then((arr) => {
let text = arr.map((x) => safeJson(x)).join('\n') || '[]'
const max = 180000
let truncated = false
if (text.length > max) {
text = text.slice(0, max) + '\n...(truncated for clipboard)'
truncated = true
}
return new Promise((resolve, reject) => {
uni.setClipboardData({
data: text,
success() {
resolve({
count: arr.length,
truncated
})
},
fail: reject
})
})
})
}

/**

  • 日志已按日落盘在「下载」根目录,此函数仅返回说明文案(便于弹窗提示运维)。
    */
    export function exportClientLogsToAppDocJsonl() {
    return waitLogWritesDone().then(() =>
    getClientLogQueue().then((arr) =>
    Promise.resolve({
    name: ${LOG_FILE_NAME_PREFIX}_${formatLogDate(now())}.jsonl,
    localUrl: '系统「下载」目录根下(_downloads/)',
    count: arr.length
    })
    )
    )
    }

操作步骤:

点开应用放置不动,不管那个页面都会出现这个情况,最多是在首页出现这个情况

预期结果:

整个应用只要显示在机器页面上就要能正常使用,而不是需要杀下后台再打开才使用

实际结果:

崩溃后页面点击没反应,杀下后台再点开就可以

bug描述:

应用所有功能正常使用,但是由于业务需求,机器上的应用一直显示在页面上,并且有存在长时间放置不动的情况,但是隔几个小时应用就会出现点击没有反应的情况。
查看了下日志发现SIGILL 崩溃是 Weex JS 引擎(libweexjss.so)在执行时触发的
并且崩溃时,GC大量触发

使用的是vue2,不管是在那个页面点击进去都会出现这个问题,并且耗时比较久,有测试出4个小时后才出现卡死的情况。定时器只有应用打开时对日志进行上传的定时。我认为影响不大

2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0018539a(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0018af01(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0018ae87(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 00380d9f(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 00381c03(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0037f733(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0037dff9(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 003844bb(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 00384513(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 0036bfd3(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 005565c3(unknown symbol)
2026-05-12 13:53:36.318 10997-11000 JSE pid-10997 E /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjss.so + 002a4c04(unknown symbol)
2026-05-12 13:53:36.326 10961-10996 WeexCore uni.UNIDF2DE55 E IPCException server original owner has die
2026-05-12 13:53:36.327 10961-10996 WeexCore uni.UNIDF2DE55 E IPCFutexPageQueue.cpp:66,do munmap
2026-05-12 13:53:37.570 10961-10980 WeexCore uni.UNIDF2DE55 E script_side_in_multi_process.cpp:314,IPCException ExecJS futex lock pi failed: No such process, 80002af6 10980 (0 0 0 0)
2026-05-12 13:53:37.572 10961-10980 WXBridge uni.UNIDF2DE55 E reportServerCrash instanceId:1 crashFile: /crash_dump.log
2026-05-12 13:53:37.602 10961-10980 jsengine uni.UNIDF2DE55 D callReportCrashReloadPage crashFile:/data/user/0/uni.UNIDF2DE55/app_crash/crash_dump.log
2026-05-12 13:53:37.605 10961-10980 weex uni.UNIDF2DE55 E check_biz_url : true
2026-05-12 13:53:37.610 10961-10980 weex uni.UNIDF2DE55 W app AvailMemory ---->>>1451
2026-05-12 13:53:37.610 10961-10980 DCFileUtils uni.UNIDF2DE55 I getAssetPath---------uni-jsframework.js
2026-05-12 13:53:37.654 10961-9046 ReportCrash uni.UNIDF2DE55 D commitJscCrashAlarmMonitor errMsg maps:
20040000-20080000 rw-p 00000000 00:00 0
20100000-20140000 rw-p 00000000 00:00 0
20180000-201c0000 rw-p 00000000 00:00 0
20200000-20240000 rw-p 00000000 00:00 0
20280000-202c0000 rw-p 00000000 00:00 0
20300000-20337000 rw-p 00000000 00:00 0
203c0000-20440000 rw-p 00000000 00:00 0
20540000-20580000 rw-p 00000000 00:00 0
205c0000-20600000 rw-p 00000000 00:00 0
206c0000-20700000 rw-p 00000000 00:00 0
20740000-20780000 rw-p 00000000 00:00 0
20840000-20880000 rw-p 00000000 00:00 0
208c0000-20900000 rw-p 00000000 00:00 0
20940000-20980000 rw-p 00000000 00:00 0
209c0000-20a40000 rw-p 00000000 00:00 0
20b00000-20b80000 rw-p 00000000 00:00 0
20d40000-20d80000 rw-p 00000000 00:00 0
20dc0000-20e00000 rw-p 00000000 00:00 0
20e80000-20ec0000 rw-p 00000000 00:00 0
20f80000-20fc0000 ---p 00000000 00:00 0
21000000-21040000 rw-p 00000000 00:00 0
21100000-21140000 rw-p 00000000 00:00 0
21180000-21200000 rw-p 00000000 00:00 0
21240000-21300000 rw-p 00000000 00:00 0
21340000-21380000 rw-p 00000000 00:00 0
213c0000-21480000 rw-p 00000000 00:00 0
214c0000-21500000 rw-p 00000000 00:00 0
21640000-216c0000 rw-p 00000000 00:00 0
21800000-218c0000 rw-p 00000000 00:00 0
21900000-21940000 rw-p 00000000 00:00 0
21a00000-21a40000 rw-p 00000000 00:00 0
21a80000-21ac0000 rw-p 00000000 00:00 0
21b00000-21b40000 rw-p 00000000 00:00 0
21c80000-21cc0000 rw-p 00000000 00:00 0
21d00000-21d80000 rw-p 00000000 00:00 0
21dc0000-21e00000 rw-p 00000000 00:00 0
21e80000-21ec0000 rw-p 00000000 00:00 0
21f80000-21fc0000 rw-p 00000000 00:00 0
22040000-22080000 rw-p 00000000 00:00 0
22080000-220c0000 ---p 00000000 00:00 0
221c0000-22200000 rw-p 00000000 00:00 0
22280000-222c0000 rw-p 00000000 00:00 0
22340000-22380000 rw-p 00000000 00:00 0
22400000-22440000 rw-p 00000000 00:00 0
22480000-224c0000 rw-p 00000000 00:00 0
22500000-22580000 rw-p 00000000 00:00 0
22680000-226c0000 rw-p 00000000 00:00 0
22700000-22740000 rw-p 00000000 00:00 0
22780000-227c0000 rw-p 00000000 00:00 0
22940000-22980000 rw-p 00000000 00:00 0
22a00000-22a40000 rw-p 00000000 00:00 0
22a80000-22ac0000 rw-p 00000000 00:00 0
22b00000-22b40000 rw-p 00000000 00:00 0
22b80000-22bc0000 rw-p 00000000 00:00 0
22c80000-22cc0000 rw-p 00000000 00:00 0
22e40000-22e80000 rw-p 00000000 00:00 0
22f00000-22f40000 rw-p 00000000 00:00 0
22fc0000-23000000 rw-p 00000000 00:00 0
230c0000-23100000 rw-p 00000000 00:00 0
231c0000-23200000 rw-p 00000000 00:00 0
23240000-23280000 rw-p 00000000 00:00 0
23440000-23471000 rw-p 00000000 00:00 0
23480000-234c0000 rw-p 00000000 00:00 0
23540000-23580000 rw-p 00000000 00:00 0
235c0000-23600000 rw-p 00000000 00:00 0
23640000-23680000 rw-p 00000000 00:00 0
236c0000-23700000 rw-p 00000000 00:00 0
23740000-23780000 rw-p 00000000 00:00 0
23800000-23801000 rw-p 00000000 00:00 0
23801000-23802000 ---p 00000000 00:00 0
23802000-2383f000 r-xp 00000000 00:00 0
2383f000-23840000 ---p 00000000 00:00 0
23840000-23880000 rw-p 00000000 00:00 0
238c0000-23900000 rw-p 00000000 00:00 0
23980000-239c0000 rw-p 00000000 00:00 0
23ac0000-23b00000 rw-p 00000000 00:00 0
23b40000-23b80000 rw-p 00000000 00:00 0
23bc0000-23c00000 rw-p 00000000 00:00 0
23c80000-23cc0000 rw-p 00000000 00:00 0
23d80000-23dc0000 rw-p 00000000 00:00 0
23f40000-23fc0000 rw-p 00000000 00:00 0
24080000-240c0000 rw-p 00000000 00:00 0
24100000-24140000 rw-p 00000000 00:00 0
24200000-24240000 rw-p 00000000 00:00 0
242c0000-24300000 rw-p 00000000 00:00 0
243c0000-24400000 rw-p 00000000 00:00 0
24440000-244c0000 rw-p 00000000 00:00 0
24500000-24540000 rw-p 00000000 00:00 0
24580000-245c0000 rw-p 00000000 00:00 0
24600000-24640000 rw-p 00000000 00:00 0
246c0000-24700000 rw-p 00000000 00:00 0
24840000-24880000 rw-p 00000000 00:00 0
249c0000-24a00000 rw-p 00000000 00:00 0
24a40000-24a80000 rw-p 00000000 00:00 0
24ac0000-24b00000 rw-p 00000000 00:00 0
24b40000-24b80000 rw-p 00000000 00:00 0
24bc0000-24c40000 rw-p 00000000 00:00 0
24c80000-24cc0000 rw-p 00000000 00:0
2026-05-12 13:53:37.655 10961-9046 weex uni.UNIDF2DE55 E errCode:-2112,function:callReportCrash,exception:weex core process crash and restart exception
2026-05-12 13:53:37.676 10961-10980 WXParams uni.UNIDF2DE55 E setCrashFilePath: /data/user/0/uni.UNIDF2DE55/app_crash
2026-05-12 13:53:37.676 10961-10980 weex uni.UNIDF2DE55 E getUseSingleProcess is running false
2026-05-12 13:53:37.676 10961-10980 weex uni.UNIDF2DE55 E getReleaseMap:true
2026-05-12 13:53:37.677 10961-10980 weex uni.UNIDF2DE55 E getLibJsbPath is running /data/user/0/uni.UNIDF2DE55/cache/cache/weex/libs/weexjsb/armeabi-v7a/libweexjsb.so
2026-05-12 13:53:37.677 10961-10980 weex uni.UNIDF2DE55 E getLibLdPath is running /data/app/uni.UNIDF2DE55-1/lib/arm:/data/app/uni.UNIDF2DE55-1/base.apk!/lib/armeabi-v7a
2026-05-12 13:53:37.681 10961-10980 WeexCore uni.UNIDF2DE55 E startupPie :1
2026-05-12 13:53:37.696 9050-9050 WeexCore uni.UNIDF2DE55 D jsengine#weexcore fork child succes!
2026-05-12 13:53:37.693 9050-9050 WeexJSBridgeThr uni.UNIDF2DE55 I type=1400 audit(0.0:102): avc: denied { setattr } for name="libweexjsb.so" dev="mmcblk1p14" ino=4015 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:apk_data_file:s0 tclass=file permissive=1
2026-05-12 13:53:37.713 9050-9050 linker uni.UNIDF2DE55 W /data/app/uni.UNIDF2DE55-1/lib/arm/libweexjsb.so: unsupported flags DT_FLAGS_1=0x8000001
2026-05-12 13:53:37.723 9050-9050 JSE uni.UNIDF2DE55 I jse start success!![3bf37bbb537a56c460b6a8c50a9e850e6bdb61bb]
2026-05-12 13:53:37.724 10961-10980 WeexCore uni.UNIDF2DE55 E script_bridge_in_multi_process.cpp:1116,ScriptBridgeInMultiProcess DELETE
2026-05-12 13:53:37.724 10961-10980 WeexCore uni.UNIDF2DE55 E IPCFutexPageQueue.cpp:66,do munmap
2026-05-12 13:53:37.734 9050-9051 JSE uni.UNIDF2DE55 I ScriptBridgeInMultiProcess::InitFramework
2026-05-12 13:53:37.743 9050-9053 JSE uni.UNIDF2DE55 I v8performance-InitV8[7]ms
2026-05-12 13:53:37.754 10961-10980 weex uni.UNIDF2DE55 W app AvailMemory ---->>>1441
2026-05-12 13:53:37.775 9050-9051 JSE uni.UNIDF2DE55 I ScriptBridgeInMultiProcess::ExecJSService
2026-05-12 13:53:37.776 9050-9051 JSE uni.UNIDF2DE55 I ScriptBridgeInMultiProcess::ExecJSService
2026-05-12 13:54:39.336 10961-10961 art uni.UNIDF2DE55 I hprof: heap dump "/data/local/tmp/perfd/cache/complete/101623635539663" starting...
2026-05-12 13:54:40.912 10961-10961 art uni.UNIDF2DE55 I hprof: heap dump completed (19MB) in 1.575s objects 263858 objects with stack traces 0
2026-05-12 13:54:41.013 10961-10961 Choreographer uni.UNIDF2DE55 I Skipped 100 frames! The application may be doing too much work on its main thread.
2026-05-12 13:55:37.068 10961-10968 art uni.UNIDF2DE55 I Enabling alloc tracker (524288 entries of 16 frames, taking up to 84MB)
2026-05-12 13:55:37.081 10961-10968 art uni.UNIDF2DE55 I Debugger is no longer active
2026-05-12 13:55:37.081 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:55:47.079 10961-10968 art uni.UNIDF2DE55 I recent allocation records: 51
2026-05-12 13:55:47.079 10961-10968 art uni.UNIDF2DE55 I allocation records all objects: 51
2026-05-12 13:55:47.093 10961-10968 art uni.UNIDF2DE55 I Disabling alloc tracker
2026-05-12 13:55:47.099 10961-10968 art uni.UNIDF2DE55 I Debugger is no longer active
2026-05-12 13:55:47.099 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:56:08.301 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:56:08.429 10961-10968 art uni.UNIDF2DE55 I Debugger is no longer active
2026-05-12 13:56:08.429 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:56:08.435 10961-10968 art uni.UNIDF2DE55 I Debugger is no longer active
2026-05-12 13:56:08.435 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:56:17.883 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation
2026-05-12 13:56:18.315 10961-10968 art uni.UNIDF2DE55 I Debugger is no longer active
2026-05-12 13:56:18.315 10961-10968 art uni.UNIDF2DE55 I Starting a blocking GC Instrumentation

2026-05-12 15:01 负责人:无 分享
已邀请:
Ask小助手

Ask小助手 - Ask社区AI助手

欢迎到专业群( uni-app 官方技术交流群 1 ) 咨询,群中有相关专业的管理员和群友。

作为DCloud官方人员,我对这份bug反馈进行评审。

一、 反馈内容完整性评审

这份反馈在关键信息的提供上存在严重缺失,目前属于低质量反馈,无法直接进入技术排查流程。

1. BUG描述

  • 评价:描述相对清晰,点明了“长时间运行”、“SIGILL崩溃”、“libweexjss.so”和“GC大量触发”这几个关键现象。
  • 缺失未提供HBuilderX版本号、项目是Vue2还是Vue3、使用的uni-app还是uni-app x。这些基础信息对于定位框架层面的问题至关重要。

2. 代码示例

  • 评价完全缺失。反馈中只有日志,没有任何业务代码片段。
  • 问题:长时间运行后崩溃通常与内存泄漏、定时器未清理、持续的网络轮询或动画未销毁有关。不提供代码,我们完全无法判断问题是由框架底层引起,还是由前端业务代码逻辑不当导致。

3. 复现步骤

  • 评价:描述模糊。
  • 问题:“长时间放置不动”不是一种具有操作性的复现步骤。我们需要知道:应用停留在哪个具体页面?该页面是vue还是nvue?页面中有哪些操作(如视频播放、地图、实时通信、定时器、WebSocket)?崩溃是必然发生在某个功能页面,还是任何页面都会发生?没有这些信息,我们无法在本地环境复现,也就无法定位。

4. 分类信息

  • 评价:严重不完整。
  • 缺失:完全没有提供HBuilderX的版本号、设备型号、Android系统版本。日志中虽然显示了包名和库文件,但缺少这些显式的开发环境信息,会导致问题追踪链断裂。

二、 Bug是否成立分析

结论:从现象看,这是一个高度疑似成立的严重Bug,但目前无法定性

崩溃发生在 libweexjss.so 中,并伴随 SIGILL 信号和 IPCException server original owner has die 日志,这表明是uni-app App端的Weex JS引擎底层进程发生了非法指令崩溃,进而导致与主进程的IPC通信中断。

对于这种涉及底层引擎的长时间运行崩溃,我们最需要的信息是使用最新版HBuilderX测试以及提供可复现的工程。我在知识库中找到了类似情况的处理参考:
在历史ISSUE中,有用户提交过类似的Native崩溃日志,当时官方的回复是要求提供更具体的信息并建议到社区发帖追踪。链接
同时,在另一段官方与用户的对话中,针对难以复现的底层崩溃,官方也建议:“辛苦在 ask 社区或者 issues 系统里发一个帖子,带着目前已知的信息,方便追踪。目前看这个没啥具体的报错,不好排查,如果有稳定的复现步骤会好很多”。

替代方案或排查建议
由于缺少代码,无法给出具体修复方案。但基于经验,建议您先自行排查前端逻辑:

  1. 检查定时器/动画:检查页面中是否有 setIntervalrequestAnimationFramewx.createAnimation 等未在页面隐藏/卸载时清除。
  2. 检查WebSocket/轮询:长时间运行下,持续的网络连接和数据处理可能导致JS引擎内存压力过大。
  3. 升级环境:请务必使用最新的 HBuilderX 正式版(5.07)Alpha版(5.08) 重新打包测试,确认问题在新版本中是否已修复。

三、 基本概念问题检查

该反馈在平台概念上没有明显的混淆。用户明确指出了在Android Studio中运行,使用的是 libweexjss.so,这属于uni-app App端(非uni-app x)的典型特征。


总结与后续要求

目前这份Bug反馈无法被处理。为了推动问题解决,请您补充以下关键信息并重新提交反馈,最好直接发布到ask社区

  1. 开发环境:HBuilderX的具体版本号。
  2. 运行环境:测试设备的型号和Android系统版本。
  3. 可复现的最小化工程:请提供一个精简后的、去掉业务无关代码的完整项目。这是最重要的一步,没有工程我们无法复现。
  4. 详细的复现路径:具体停留在哪个页面、页面中有什么元素和逻辑、大概多久会崩溃。

请在补充以上信息后,新发一个帖子并提供链接,我们会安排专人跟进。

内容为 AI 生成,仅供参考

要回复问题请先登录注册