Build error when compiling using IL2CPP for Android if project uses static NetworkVariables
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- android, csharp
- Domaine
- game-dev, networking
Piste de recherche
Commencez par reproduire le cas signalé d’une NetworkVariable statique dans un NetworkBehaviour, puis construisez le projet pour Android avec IL2CPP et Mono afin de comparer les résultats. Suivez la sortie IL2CPP générée et les membres manquants signalés ; c’est terminé lorsque la compilation IL2CPP pour Android se termine sans erreur.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Description
Build error when compiling using IL2CPP for Android if project uses static NetworkVariables. This behaviour happens when attempting to build using IL2CPP scripting backend and building to Android. Building to Android using Mono builds successfully with no errors, leading me to believe this is a bug/unintended.
Reproduce Steps
- Declare a static NetworkVariable in a NetworkBehaviour script. (
public static NetworkVariable<int>in my case) - Set scripting backend to IL2CPP
- Set build platform to Android
- Build
- Error displayed as shown in Additional Context section
Actual Outcome
Build fails with two error messages in console.
Expected Outcome
Build should compile successfully with no errors.
Screenshots
Error in Console:
Environment
- OS: [Windows 10]
- Unity Version: [2022.3.9f1]
- Netcode Version: [1.5.2]
- Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/ba418fa5b600ad9eb61fab0575f12fbecc2c6520]
Additional Context
Full Error Logs:
Building Library\Bee\artifacts\Android\iz17e\25857ix1c827.o failed with output:
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5692,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_0 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5708,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_3 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5711,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_4 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5714,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_6 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5717,78): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_7 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5733,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_10 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5736,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_11 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5739,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_13 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
8 errors generated.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Building Library\Bee\artifacts\Android\d8kzr\25857ix1c827.o failed with output:
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5692,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_0 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5708,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_3 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5711,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_4 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5714,78): error: no member named '___HostPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_6 = __this->___HostPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5717,78): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_7 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5733,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_10 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5736,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_11 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
L:\Career\Development\Unity\GitHub\PrototypeCRF\Library\Bee\artifacts\Android\il2cppOutput\cpp\Assembly-CSharp.cpp(5739,79): error: no member named '___OtherClientPlayerHealth' in 'HubManager_t257E0CCDF9E261EA4899F86EEF4B1C6AAEEF8922'
NetworkVariable_1_t72006E2365F7131BBF61213343C271666361F504* L_13 = __this->___OtherClientPlayerHealth;
~~~~~~ ^
8 errors generated.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
- Langage dominant
- C#
- Étoiles
- 2.3k
- Forks
- 461
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 20
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Unity-Technologies/com.unity.netcode.gameobjects
-
stat:import type:bug
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
-
stat:reply-needed type:support
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 commentaires ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · 5 commentaires · 1 personne assignée ·
-
Tracking type:feature-2.x
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 commentaires ·
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpy OuverteTracking type:feature
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 commentaires ·
Toutes les issues de Unity-Technologies/com.unity.netcode.gameobjects
Issues similaires
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
azurenoops/spin_agent#975 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulté 2/5 1-3 heures Accessibilité débutants 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
SubtitleEdit/subtitleedit#15108 · 1 commentaire ·