2017-06-21 1 views
0

Je suis un développeur AR amateur travaillant sur un projet pendant mon temps libre. La construction idéale pour ce projet serait une application WebGL. Toutefois, la génération WebGL que j'ai créée dans Unity ne s'exécute pas. J'ai essayé d'exécuter l'index.html sur Chrome et Firefox, et sur un site d'hébergement gratuit. Lorsque je tente d'exécuter le fichier, je reçois cette erreur:Application Unity3D AR Erreurs de génération de rapports WebGL

An error occured running the Unity content on this page. See your browser JavaScript console for more info. The error was: 
uncaught exception: abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking") at jsStackTrace (signTest1WGL.asm.framework.unityweb:2:27465) 
stackTrace (signTest1WGL.asm.framework.unityweb:2:27636) 
abort (signTest1WGL.asm.framework.unityweb:4:30633) 
_dlopen (signTest1WGL.asm.framework.unityweb:2:184717) 
c0k (blob:20:1) 
g9k (blob:20:1) 
mSk (blob:20:1) 
SMg (blob:7:1) 
CSg (blob:7:1) 
BSg (blob:7:1) 
_Nj (blob:4:1) 
s0g (blob:7:1) 
A3f (blob:6:1) 
$7f (blob:6:1) 
l5i (blob:4:1) 
csl (blob:28:1) 
invoke_iiii (signTest1WGL.asm.framework.unityweb:2:353269) 
WAk (blob:15:1) 
cBk (blob:15:1) 
bBk (blob:15:1) 
HTk (blob:20:1) 
vql (blob:28:1) 
invoke_iiiii (signTest1WGL.asm.framework.unityweb:2:336227) 
yGh (blob:10:1) 
GEh (blob:10:1) 
JQe (blob:8:1) 
TKf (blob:5:1) 
IQe (blob:8:1) 
csl (blob:28:1) 
invoke_iiii (signTest1WGL.asm.framework.unityweb:2:353269) 
Xeg (blob:6:1) 
Weg (blob:6:1) 
a5f (blob:6:1) 
Jdk (blob:15:1) 
l5i (blob:4:1) 
csl (blob:28:1) 
invoke_iiii (signTest1WGL.asm.framework.unityweb:2:353269) 
WAk (blob:15:1) 
KEk (blob:15:1) 
WM (blob:9:1) 
p9 (blob:16:1) 
frb (blob:11:1) 
_qb (blob:11:1) 
r$a (blob:13:1) 
Iqb (blob:11:1) 
JQ (blob:9:1) 
xda (blob:16:1) 
_9 (blob:16:1) 
aaa (blob:16:1) 
V9 (blob:16:1) 
A8 (blob:16:1) 
z8 (blob:16:1) 
x8 (blob:16:1) 
u8 (blob:16:1) 
iZ (blob:16:1) 
WY (blob:16:1) 
callMain (signTest1WGL.asm.framework.unityweb:4:28998) 
doRun (signTest1WGL.asm.framework.unityweb:4:29701) 
run (signTest1WGL.asm.framework.unityweb:4:29887) 
runCaller (signTest1WGL.asm.framework.unityweb:4:28515) 
removeRunDependency (signTest1WGL.asm.framework.unityweb:2:34431) 
UnityLoader["73d8c219198d5cb59ea52845978d71e1"]/</unityFileSystemInit</<@blob:https://signtest1.000webhostapp.com/5a52587b-4b95-e748-aec6-c32e11164deb:2:357 
doCallback (signTest1WGL.asm.framework.unityweb:2:143411) 
done (signTest1WGL.asm.framework.unityweb:2:143549) 
done (signTest1WGL.asm.framework.unityweb:2:126612) 
storeLocalEntry (signTest1WGL.asm.framework.unityweb:2:125072) 
UnityLoader["73d8c219198d5cb59ea52845978d71e1"]/reconcile/</<@blob:https://signtest1.000webhostapp.com/5a52587b-4b95-e748-aec6-c32e11164deb:2:126838 
UnityLoader["73d8c219198d5cb59ea52845978d71e1"]/loadRemoteEntry [loadRemoteEntry/req.onsuccess] (signTest1WGL.asm.framework.unityweb:2:125422) 

If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information. 

Embrouillant, ce projet se déroule comme prévu à la fois ma webcam pour ordinateur portable (Mac) et mon iPhone. Ce n'est qu'une fois que j'ai choisi de construire avec le problème WebGL que j'ai rencontré ces problèmes. Je ne connais pas très bien WebGL et je ne connais pas grand chose à la résolution de cette erreur. Comment puis-je résoudre cette erreur et exécuter correctement un projet Unity avec WebGL?

Ce site est également hébergé à https://signtest1.000webhostapp.com/ Vous pouvez voir l'erreur et regarder la console là-bas.

Répondre

0

J'ai trouvé que mon problème dans la construction de ce projet Unity était mon utilisation du paquet Vuforia AR dans Unity. Vuforia ne supporte que le développement mobile natif et n'est pas du tout compatible avec WebGL.

J'ai trouvé une solution de contournement potentielle pour ce problème sous la forme de argon.js, un framework JavaScript pour ajouter de la réalité augmentée dans les applications web. En théorie, le cadre permet aux projets Vuforia de fonctionner dans tous les navigateurs Web. La documentation de argon.js se trouve ici:

https://www.argonjs.io/

Une bonne compréhension de JavaScript est utile.