Unity Android接收信号崩溃

huangapple go评论102阅读模式
英文:

Unity Android receiving signal crashes

问题

Backstory

我使用IL2CPP将我的Unity应用程序构建为Android x64,这在过去一直很正常,但在经过许多更改后,现在出现了一些突然崩溃的情况。

收到的信号:

  • 信号6(SIGABRT),代码-1(SI_QUEUE)
  • 信号11(SIGSEGV),代码2(SEGV_ACCERR)
  • 信号11(SIGSEGV),代码1(SEGV_MAPERR)
  • 信号7(SIGBUS),代码1(BUS_ADRALN)

我除了知道这个崩溃只在Android上发生外,没有太多线索,而不是在我的64位Win11 Unity编辑器或32位Android上发生(仍然使用IL2CPP构建)。

Question

我应该从哪里开始排除这个问题?

Potential Solution

在收集信息以发布这个问题时,我偶然发现了一个解决方法,尽管我仍然不确定根本问题是什么。

  • 了解到构建会为后续构建存储一些IL2CPP缓存,我决定切换构建类型
  • 我将构建设置 > 玩家设置 > Android设置 > 脚本后端设置为“Mono”
  • 没有信号崩溃
  • 我将脚本后端设置回IL2CPP,仍然没有信号崩溃

我最好的猜测是之前构建的缓存有问题。

英文:

Backstory

I built my unity app to android x64 using IL2CPP which has worked fine in the past but after a lot of changes I'm now getting crashes somewhat spontaneously.

Signals received:

  • signal 6 (SIGABRT), code -1 (SI_QUEUE)
  • signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
  • signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
  • signal 7 (SIGBUS), code 1 (BUS_ADRALN)

I don't have much to go on other than I only get see this crash on android, not my 64bit win11 unity editor nor 32bit Android (still built with il2cpp).

Question

Where do I even start to troubleshoot this ?

Potential Solution

While gathering information to post this question I stumbled across a solution although I'm still 100% sure of the underlying issue.

  • Knowing that builds store some IL2CPP cache for subsequent builds I decided to switch build types
  • I set Build Settings > Player Settings > Android Settings > Scripting Backend to "Mono"
  • No signal crashes
  • I set the Scripting Backend back to IL2CPP and still not signal crashes

My best guess is bad cache from a previous build.

答案1

得分: 0

For anyone else who runs into this issue: it seems il2cpp related. The easiest fix seems to be switching build type (il2ccp <> mono) and back. Sometimes I've had to go as far as a mixture of cleaning the build from within android studio and/or cleaning the build from unity, followed by resetting my .git project with $ git checkout ..

英文:

For anyone else who runs into this issue: it seems il2cpp related. The easiest fix seems to be switching build type (il2ccp <> mono) and back. Sometimes I've had to go as far as a mixture of cleaning the build from within android studio and/or cleaning the build from unity, followed by resetting my .git project with $ git checkout ..

huangapple
  • 本文由 发表于 2023年5月11日 06:06:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222872.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定