Unity network connection error

NetworkConnectionError Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Submission failed For some reason your suggested change could not be submitted. Please try again in a few minutes. And […]

Содержание

  1. NetworkConnectionError
  2. Success!
  3. Submission failed
  4. Description
  5. Properties
  6. NetworkError
  7. Success!
  8. Submission failed
  9. Description
  10. Properties
  11. Diagnose network issues
  12. Method 1: Use the Unity Package Manager Error dialog
  13. Method 2: Manually run the script
  14. Network issues
  15. Using the Diagnostics tool
  16. Launch from the Unity Package Manager Error dialog
  17. Launch via script
  18. Configuring your firewall
  19. Configuring your proxy server
  20. Self-signed certificates
  21. Setting environment variables for the Unity Hub
  22. Windows
  23. macOS

NetworkConnectionError

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Submission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Description

Possible status messages returned by Network.Connect and in OnFailedToConnect in case the error was not immediate.

Properties

NoError No error occurred.
RSAPublicKeyMismatch We presented an RSA public key which does not match what the system we connected to is using.
InvalidPassword The server is using a password and has refused our connection because we did not set the correct password.
ConnectionFailed Connection attempt failed, possibly because of internal connectivity problems.
TooManyConnectedPlayers The server is at full capacity, failed to connect.
ConnectionBanned We are banned from the system we attempted to connect to (likely temporarily).
AlreadyConnectedToServer We are already connected to this particular server (can happen after fast disconnect/reconnect).
AlreadyConnectedToAnotherServer Cannot connect to two servers at once. Close the connection before connecting again.
CreateSocketOrThreadFailure Internal error while attempting to initialize network interface. Socket possibly already in use.
IncorrectParameters Incorrect parameters given to Connect function.
EmptyConnectTarget No host target given in Connect.
InternalDirectConnectFailed Client could not connect internally to same network NAT enabled server.
NATTargetNotConnected The NAT target we are trying to connect to is not connected to the facilitator server.
NATTargetConnectionLost Connection lost while attempting to connect to NAT target.
NATPunchthroughFailed NAT punchthrough attempt has failed. The cause could be a too restrictive NAT implementation on either endpoints.

Did you find this page useful? Please give it a rating:

Thanks for rating this page!

What kind of problem would you like to report?

Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at

Thanks for letting us know! This page has been marked for review based on your feedback.

If you have time, you can provide more information to help us fix the problem faster.

You’ve told us this page needs code samples. If you’d like to help us further, you could provide a code sample, or tell us about what kind of code sample you’d like to see:

You’ve told us there are code samples on this page which don’t work. If you know how to fix it, or have something better we could use instead, please let us know:

You’ve told us there is information missing from this page. Please tell us more about what’s missing:

You’ve told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

You’ve told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

You’ve told us there is a spelling or grammar error on this page. Please tell us what’s wrong:

You’ve told us this page has a problem. Please tell us more about what’s wrong:

Thanks for helping to make the Unity documentation better!

Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.

Copyright © 2018 Unity Technologies. Publication: 2018.1-002N. Built: 2018-12-04.

Источник

NetworkError

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Submission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Description

Possible Networking.NetworkTransport errors.

A group of possible NetworkTransport errors. If an error is returned from a NetworkTransport function, you can use NetworkError to find out what type of error occured. Make sure to use NetworkTransport.Receive or similar to listen for these type of events.

Properties

Ok The operation completed successfully.
WrongHost The specified host not available.
WrongConnection The specified connectionId doesn’t exist.
WrongChannel The specified channel doesn’t exist.
NoResources Not enough resources are available to process this request.
BadMessage Not a data message.
Timeout Connection timed out.
MessageToLong The message is too long to fit the buffer.
WrongOperation Operation is not supported.
VersionMismatch The protocol versions are not compatible. Check your library versions.
CRCMismatch The Networking.ConnectionConfig does not match the other endpoint.
DNSFailure The address supplied to connect to was invalid or could not be resolved.
UsageError This error will occur if any function is called with inappropriate parameter values.

Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.

Copyright ©2023 Unity Technologies. Publication Date: 2023-01-06.

Источник

Diagnose network issues

Use the Unity Package Manager Diagnostics tool to help diagnose common network issues associated with Unity Package Manager. The Diagnostics tool runs some basic network tests and creates files that the Unity support team needs to diagnose common network problems. After you run the tool, you can share the results with the Unity support team who can better guide you in resolving those issues.

To diagnose network issues:

Run the Unity Package Manager Diagnostics tool by using either the Unity Package Manager Error dialog or by Manually running the script.

View the test results in the shell window. The tool output also lists the location of the upm-diagnostic-report.txt report and the upm-diag.log file that it created.

If you need help from the Unity support team, include upm-diagnostic-report.txt and upm-diag.log when you submit a bug.

Method 1: Use the Unity Package Manager Error dialog

When Unity tries to launch, it starts the Package Manager process before it loads the project. If it encounters a critical error with Package Manager, Unity displays the following error message:

Critical error dialog appears prompting you for action

To run the Diagnostics tool, click Diagnose. Unity closes and launches the Diagnostics tool in a new window.

Method 2: Manually run the script

Locate the RunUnityPackageManagerDiagnostics script in the Diagnostics folder within the installation folder for your Unity Editor:

Источник

Network issues

Use the Unity Package Manager Diagnostics tool to diagnose common network-related issues associated with Unity Package Manager. The Diagnostics tool runs some basic network tests that the Unity support team needs in order to diagnose common network problems. After you run the tool, you can share the results with the Unity support team who can better guide you in resolving those issues.

You can run the Unity Package Manager Diagnostics either through the Unity Package Manager Error dialog or by manually running the launch script.

After the Diagnostics tool finishes, it displays the results of the tests in the shell window. It also writes a log file and a report file, which you can open from the shell window:

Diagnostic report on top of the tool results in the shell window

After running Unity Package Manager Diagnostics, you can:

  • Ask for support in the Package Manager area of the Unity forums and attach the diagnostic report.
  • Submit a bug and include the report.

Launch from the Unity Package Manager Error dialog

When Unity tries to launch, it starts the Package Manager process before it loads the project. If it encounters a critical error with Package Manager, Unity displays the following error message:

Critical error dialog appears prompting you for action

To run the Diagnose tool, click Diagnose. Unity closes and launches the Diagnostics tool in a new window.

Launch via script

Locate the script in the Diagnostics folder under the Unity installation folder:

Unity
Data
Resources
PackageManager
Diagnostics
RunUnityPackageManagerDiagnostics.bat

Unity.app
Contents
Resources
PackageManager
Diagnostics
RunUnityPackageManagerDiagnostics

Operating system: Path to Diagnostics command-line tool:
Windows
macOS
Linux

To launch the tool, either double-click the script file in your file browser or run it from the command line.

Configuring your firewall

Make sure the Unity Package Manager can access the following domain names using HTTPS:

  • packages.unity.com
  • download.packages.unity.com
  • upm-cdn.unity.com (or upm-cdn-china.unitychina.cn for locations in China)

Add the above domain names to your firewall’s list of allowed domains.

Configuring your proxy server

When using a proxy server, configure the HTTP_PROXY and HTTPS_PROXY environment variables for the Unity Package Manager to use when performing requests against the Unity package registry.

You can set these variables globally (either system or user variables) according to your operating system. Alternatively, you can set them only for the Unity Hub when it launches.

For environments where you are behind a firewall, you can configure SSL certificate authorities for self-signed certificates.

Self-signed certificates

In some corporations and institutions, users are behind a firewall and can only access the internet through a proxy. Some proxies unpack the HTTPS content and repack it with its own self-signed certificate. Unity Package Manager’s underlying HTTPS layer rejects these self-signed certificates because it does not recognize them, and treats the connection as a possible man-in-the-middle attack. This means that you can’t use many features in Unity, including the Package Manager, unless you configure additional SSL certificate authorities to allow these certificates.

To configure additional SSL certificate authorities:

Create a text file with one or more custom certificate authorities. The file should consist of one or more trusted certificates in the Privacy-Enhanced Mail (PEM) format. For example:

Put this file in the same location as upm-config.json if possible, although Unity supports any location on the file system.

Create an empty JSON file named upm-config.json in the system-level Unity configuration folder:

  • Windows: %ALLUSERSPROFILE%Unity/config
  • macOS: /Library/Application Support/Unity/config
  • Linux: /usr/share/unity3d/config

In the upm-config.json file, add the caFile attribute set to the absolute file path for your PEM file. For example:

Setting environment variables for the Unity Hub

This section provides instructions for creating a command file you can run from a Windows command prompt or a macOS or Linux terminal. Alternatively, you can copy and paste the commands directly into the prompt or terminal window.

Note: Before you run the command file, shut down the Hub completely. If the Hub is already running, the script switches focus to the Hub without relaunching, so it does not apply the changed proxy settings.

Windows

These instructions create a command file on Windows.

The file launches the Hub with the environment variables set. You can either double-click the file, or invoke it from the command prompt. Unity passes these environment variables on to any Unity Editor process launched from the Hub.

Open a text editor such as Notepad.

Enter the following text, replacing proxy-url with the correct proxy server URL and adjusting the Hub install path if needed:

Note: If there are spaces in the path, you must use double quotes around the path to the program.

Save the file to a location where you can easily find it (such as the Desktop ), and make sure the file has the .cmd (for example, launchUnityHub.cmd ).

macOS

These instructions create the launchUnityHub.command file on macOS.

The file launches the Hub with the environment variables set. You can either double-click the file, or invoke it from a Bash terminal. Unity passes these environment variables on to any Unity Editor process launched from the Hub.

Note: Double-clicking the command file opens a Terminal window or tab and leaves it open, even after the script finishes. You can change this behavior in the preferences for the Terminal.app.

Open a Terminal window.

Enter the following script, replacing proxy-url with the correct proxy server URL and adjusting the Hub install path if needed:

Note: If there are spaces in the path, you must use double quotes around the path to the program.

Источник

проблема с Network.Connect()

Здравствуйте!
в общем столкнулся с такой проблемой:

при попытке подсоеденения к серверу выдается такая ошибка:

NAT target 127 not connected to NAT facilitator 67.225.180.24:50005

ip у меня публичный и я не понимаю в чем проблема

помогите плиз..

код:

Используется csharp

void Update()
{

if(GUI.Button(new Rect(10,60,50,50),«Create»))
                {
                        CreateServer();
                        Application.LoadLevel(«1»);
                }
                if(GUI.Button(new Rect(10,120,50,50),«connect»))
                {
                        Connect();

                       
                }
}

public void Connect()
        {

       
                Network.Connect(ip);

               
                if (Network.isClient) Debug.Log(«Connected with server!»); else Debug.LogWarning(«Connected with server has been crashed !»);

               
        }

public void CreateServer()
        {

       
                useNat = !Network.HavePublicAddress();
Network.InitializeServer(32, port,true);
}

akkel
UNIт
 
Сообщения: 76
Зарегистрирован: 23 июн 2009, 07:03
Откуда: Ростов-На-Дону

Re: проблема с Network.Connect()

Сообщение Berenold 01 авг 2011, 18:28

Используется csharp

using UnityEngine;
using System.Collections;

public class Connect : MonoBehaviour
{
    public string connectToIP = «92.249.121.143»;
    public int connectPort = 45678;

    // Смешанный GUI для сервера и клиента
    public void OnGUI()
    {
        if (Network.peerType == NetworkPeerType.Disconnected)
        {
            //Сейчас мы отключены и не являемся клиентом или хостом
            GUILayout.Label(«Connection status: Disconnected»);
            connectToIP = GUILayout.TextField(connectToIP, GUILayout.MinWidth(100));
            connectPort = int.Parse(GUILayout.TextField(connectPort.ToString()));
            GUILayout.BeginVertical();

            if (GUILayout.Button(«Connect as client»))
            {
                // Подсоединяемся к «connectToIP» и «connectPort» как клиент
                // В данном случае игнорируем NAT
                Network.useNat = false;
                Network.Connect(connectToIP, connectPort);
            }

            if (GUILayout.Button(«Start Server»))
            {
                // Создаем север с 32 клиентами используя порт «connectPort»
                // Так же игнорируем NAT
                Network.useNat = false;
                Network.InitializeServer(32, connectPort);
            }

            GUILayout.EndVertical();
        }
        else
        {
            //Мы имеем подключение(я)!
            if (Network.peerType == NetworkPeerType.Connecting)
            {
                // Статус — пдключение
                GUILayout.Label(«Connection status: Connecting»);
            }

            else if (Network.peerType == NetworkPeerType.Client)
            {
                // Статус — клиент
                GUILayout.Label(«Connection status: Client!»);
                GUILayout.Label(«Ping to server: « + Network.GetAveragePing(Network.connections[0]));
            }

            else if (Network.peerType == NetworkPeerType.Server)
            {
                // Статус — сервер
                GUILayout.Label(«Connection status: Server!»);
                GUILayout.Label(«Connections: « + Network.connections.Length);
                if (Network.connections.Length < 1)
                {
                    GUILayout.Label(«Ping to first player: « + Network.GetAveragePing(Network.connections[0]));
                }
            }

            if (GUILayout.Button(«Disconnect»))
            {
                Network.Disconnect(200);
            }
        }
    }
}

Так жу могу посовчетовать прочитать M2H. лично мне очень помогло.

Невозможное возможно!

Аватара пользователя
Berenold
UNITрон
 
Сообщения: 151
Зарегистрирован: 31 июл 2010, 01:44
Откуда: Киев
  • Сайт

Re: проблема с Network.Connect()

Сообщение Hightlander 26 дек 2014, 01:26

Столкнулся с такой же ошибкой и, по скольку во всех топиках по запросу через гугл не было решения, а лишь коммент топикстартера «А, все, разобрался, можно закрывать.», решил все таки написать в чем заключалась проблема у меня. Прошу прощения за некропост.

В моем случае я использовал метод:

Используется csharp

Network.Connect(string serverGUID)

Однако в параметр передавал строку с хранящимся в ней IP сервера. Для корректного подключения по IP следует использовать метод:

Используется csharp

Network.Connect(string serverIP, int Port) // serverIP — IP сервера, Port — порт для подключения, в большинстве туториалов = 25000

Hightlander
UNец
 
Сообщения: 14
Зарегистрирован: 26 дек 2014, 01:15


Вернуться в Скрипты

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2



Local folder or tarball paths

This section provides information on the following issues:

Type of error: Error message:
General startup issues — Error messages in the Package Manager window
— Package Manager missing or window doesn’t open
— Problems after upgrading Unity to new version
— Resetting your project’s package configuration
Package installation issues — Package installation fails
— Packages not recognized
— Unable to add package from Git URL
Problems installing git dependencies — No ‘git’ executable was found
— git-lfs: command not found
— Repository not found
— Could not read Username: terminal prompts disabled
— Can’t update Git version
Asset StoreA growing library of free and commercial assets created by Unity and members of the community. Offers a wide variety of assets, from textures, models and animations to whole project examples, tutorials and Editor extensions. More info
See in Glossary
packages (My Assets)
— ‘Failed to parse Http response’ in My Assets context
Scoped registries — Missing ‘My Registries’ in the Package Manager window
Issues when building packages — Missing MonoBehaviour errors
— Loading error for hostfxr.dll on Windows

You can also run the Unity Package Manager Diagnostics tool if you are experiencing problems that might be network-related. For more information, see Network issues.

Error messages in the Package Manager window

The Package Manager displays error indicators in the Package Manager window when it encounters problems.

System-wide issues

  • Network connection issues

    Error messages appear in the status bar when the Package Manager has detected an issue that isn’t related to a specific package. For example, if the Package Manager can’t access the package registry server, it displays this message in the status bar:

    Network error message

    Network error message
  • Error refreshing assets (or Error refreshing packages)

    If your network can’t reach the package registry server, it’s probably because there is a connection problem with the network. When you or your system administrator fix the network error, the status bar clears.

    If your network connection is working, but you aren’t signed into your Unity account, the Package Manager doesn’t display any Asset Store packages. When you try to use the My Assets context, the Package Manager displays an error in the status bar:

    Logged out of Unity account

    Logged out of Unity account

    Click the Sign in button inside the list view to sign into your Unity account through the Unity Hub.

Package-specific issues

  • If a specific package has a problem when loading or installing (for example, when determining which package versions to load), the error icon () appears in the package list next to the compromised package (A). To find out what the problem is, open the compromised package’s details view to see the detailed error message (B):

    Dependency error message

    Dependency error message

Package Manager missing or window doesn’t open

The Package Manager window might get moved offscreen or hidden by another window. When this happens, it looks like the Package Manager window failed to open. In this case, you can try to reset the window layout (Window > Layouts > Default) and reopen the Package Manager window again.

If the Package Manager window still doesn’t appear, check your Unity Console windowA Unity Editor window that shows errors, warnings and other messages generated by Unity, or your own scripts. More info
See in Glossary
:

Failed to resolve packages: The file [<project-path>/Packages/manifest.json] is not valid JSON:
  Unexpected token '}' at 44:1
  }

This error message indicates that your manifest.json file is malformed. It also tells you the line number where the Package Manager failed to parse the file, so you can fix the JSON. There are a number of online validators that you can use to try to correct the problem. Once you save the corrected file, Unity reloads the Package Manager window.

If you upgraded from an early version of the Unity Editor, there may be other problems with your package manifestEach package has a manifest, which provides information about the package to the Package Manager. The manifest contains information such as the name of the package, its version, a description for users, dependencies on other packages (if any), and other details. More info
See in Glossary
file:

  • As of 2019.3, your manifest.json file should not contain any references to the com.unity.package-manager-ui package. You can either reset your project’s package configuration or remove the following line from the manifest’s dependencies list:

        "com.unity.package-manager-ui": "2.1.1",
    
  • Check to see if your project manifestEach Unity project has a project manifest, which acts as an entry point for the Package Manager. This file must be available in the <project>/Packages directory. The Package Manager uses it to configure many things, including a list of dependencies for that project, as well as any package repository to query for packages. More info
    See in Glossary
    uses “exclude” as a package version. This is an obsolete value for the dependenciesIn the context of the Package Manager, a dependency is a specific package version (expressed in the form package_name@package_version) that a project or another package requires in order to work. Projects and packages use the dependencies attribute in their manifests to define the set of packages they require. For projects, these are considered direct dependencies; for packages, these are indirect, or transitive, dependencies. More info
    See in Glossary
    property. If you find any lines like these, remove the entire line. Package Manager only installs packages that are explicitly included as a dependency in your project, so once you remove that entry, Package Manager ignores the package and doesn’t install it.

If the Package Manager still fails to load, follow the procedures under Packages not recognized and Resetting your project’s package configuration.

Problems after upgrading Unity to new version

When you upgrade a project to a newer Unity version, the Package Manager automatically updates incompatible packages to newer compatible versions. However, if your package doesn’t compile, the Package Manager displays error messages in the Console.

To correct these messages, read the error messages and fix any problems you can. For example, a package might be missing a dependency on another package or version. In that case, you can try and install the package yourself.

You can also try the following sequence of solutions until you find something that works:

  • Back up and then delete the Packages folder under your project.
  • Back up and then delete the package sources in your project’s Packages folder, leaving only the manifest.json file. Then try to reload the project.
  • Create a new empty project. If the Package Manager window loads successfully, replace the Library/PackageCache/com.unity.package-manager-ui@<version> folder in the failing project with the same folder from the newly created project.
  • As a last resort, you can reset your project to the default packageUnity automatically pre-installs a select number of default packages (for example, the Analytics Library, Unity Timeline, etc.) when you create a new project. This differs from a bundled package because you don’t need to install it and it differs from a built-in package because it extends Unity’s features rather than being able to enable or disable them.
    See in Glossary
    configuration and add back packages one at a time until it works.

Resetting your project’s package configuration

If a project has too many package issues, you can reset your project back to the default package configuration for the Editor’s version of Unity. This operation resets all packages in your project. This might not fix the source of the problem, but it can help you figure out what the problem is.

Note: You can’t undo resetting your package configuration, so make sure you back up the manifest.json file first or make sure your project is under source control. You can also take extra precautions by cloning your project and testing out the operation on the clone before proceeding.

To return to the default package configuration, select Reset Packages to defaults from the Help menu.

Help > Reset Packages to defaults

Help > Reset Packages to defaults

Resetting a clone of your project

You can also test the return to the default packages before you perform the final change:

  1. Clone your project by copy-pasting your project folder and renaming it so that it is easy to find (for example, if your project is called MyProject then you could use something like clone_MyProject).

  2. Load your newly cloned project.

  3. From the Help menu, select Reset Packages to defaults.

    Depending on the size of your project, this might take a few minutes.

  4. Check that it successfully reset the packages. If so, you can perform the operation safely on the original project.

Package installation fails

If you are trying to install a new package from the registry and it is not working, it might be due to permission problems.

You must have full permissions on the cache folder:

  • Windows: C:UsersyournameAppDataLocalUnitycache
  • macOS: ~/Library/Unity/cache
  • Linux: ~/.config/unity3d/cache

It might be a problem with the network. Check your firewall and proxy settings.

Sometimes institutional environments, such as schools, government offices, or network-protected workplaces set up proxy servers to control traffic between the network and the Internet, and use their own server certificates which are not recognized by Unity or the Package Manager. Talk to your network administrator.

Packages not recognized

If you see a lot of compilation errors, this might indicate that Unity is not recognizing the packages in your existing project. In this case, you might be missing a .NET component.

For Windows:

  1. Download and install Visual Studio 2017 version 15.9.0 or higher with the .NET Core cross-platform development workload selected under Other Toolsets.
  2. Download and install the .NET SDK v2.2.101 component.

For MacOS:

  1. Download and install the .NET SDK v2.2.101 component.

  2. Install any recommended updates in Visual Studio

  3. Use homebrew to brew and install mono:

    brew update
    brew install mono # optional
    brew upgrade mono
    
  4. If necessary, delete the Library/obj/temp folder under your project and restart Unity.

  5. If you are still experiencing difficulties, try rebooting your computer as well.

Unable to add package from Git URL

See Repository not found.

No ‘git’ executable was found

If you try to install a package from a git URL, a message similar to this appears:

Cannot perform upm operation: Unable to add package
[https://github.example.com/myuser/myrepository.git]:
No 'git' executable was found. Please install Git on your system and restart Unity [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

git-lfs: command not found

If you are trying to download a package that uses Git LFS (Large File Storage), you might see this error message:

Error when executing git command. git-lfs filter-process: command not found.

This indicates that Git LFS is probably not installed on your machine. To make sure, you could test it on the command line:

git lfs --version

If you see something like this, Git LFS is installed:

git-lfs/2.8.0 (GitHub; darwin amd64; go 1.12.7)

Otherwise, you can install it by following the Bitbucket GitHub instructions.

Repository not found

If you specify a location that does not exist, a message similar to this one appears in the Unity Console:

Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]:
  Error when executing git command. fatal: repository 'https://mycompany.github.com/gitproject/com.mycompany.mypackage.git/' not found
 [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)

Check your spelling. To make sure you are using the correct URL, go to the repository’s page and copy the URL from the Clone button:

Where to copy the URL on GitHub (A) and GitLab (B)

Where to copy the URL on GitHub (A) and GitLab (B)

Click the button to the right of the URL on GitHub (A) or GitLab (B) to copy the URL to your clipboard.

If the location of the repository is correct, there may be another problem with the URL:

  • If you are targeting a specific revision, make sure your revision comes last. For example:
    https://github.example.com/myuser/myrepository1.git#revision
  • If you are targeting a revision and the package is not at the root, make sure the path query parameter precedes the revision anchor. For example:
    https://github.example.com/myuser/myrepository.git?path=/example/folder#v1.2.3

Could not read Username: terminal prompts disabled

If you are trying to install a package from a private repository that requires authentication, a message similar to this one appears in the Unity Console:

Cannot perform upm operation: Unable to add package [https://mycompany.github.com/gitproject/com.mycompany.mypackage.git]:
  Error when executing git command. fatal: could not read Username for 'https://mycompany.github.com': terminal prompts disabled
 [NotFound]
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:310)

This message is likely due to the fact that Package Manager does not provide an interactive terminal or dialog where you can enter your username and password for HTTP, or your passphrase to unlock your SSH key:

  • With HTTP(S), every time you log onto BitBucket, GitHub or GitLab you need to enter your username and password in a terminal or a dialog box. However, the Package Manager does not provide an interactive terminal or dialog where you can enter your username and password for HTTP(S).

    To bypass this, use one of the workarounds suggested in Solutions for HTTPS.

  • SSH uses a pair of public and private SSH keys. You can add your public SSH key to Bitbucket, GitHub or GitLab and then access repositories without having to enter a username and password.

    However, if you have set up a passphrase to keep your SSH key safe, you still have to enter that passphrase in a terminal or a dialog box in order to authorize your key. In that case, you can use an SSH agent that can unlock your SSH key to authenticate with the Package Manager on your behalf.

Solutions for HTTPS

The Package Manager does not provide an interactive terminal or dialog where you can enter your HTTP(S) username and password. To bypass this, use one of these workarounds:

  • Use a credential manager (Git Credential Manager for Windows or OSXKeyChain). Credential managers handle sending the password without having to use a terminal or a command prompt.
  • Use git-credentials from a terminal or command prompt. Then launch the Hub from the same terminal so that Unity has access to the cached or stored credentials.
  • Use SSH to authenticate instead. If you set up your SSH key without a passphrase, the Package Manager doesn’t have to decrypt it in order to authenticate with the Git server. If you decide to use a passphrase for added security, you can still get around the authentication problem by using the ssh-agent on either macOS or Windows.

Solutions for SSH

If you are using the SSH protocol to install a package by Git URL, you might get an authentication error from Git. This typically happens when you set up a private SSH key on your local machine that is protected by a passphrase.

The solution to this problem is to set up an SSH agent that can unlock your SSH key to authenticate with the Package Manager on your behalf. Follow the instructions in the section that corresponds to your operating system:

  • Setting up OpenSSH for Windows
  • Adding SSH keys to your SSH Agent for macOS

Setting up OpenSSH for Windows

The native Windows OpenSSH version of the ssh-agent works better than the version available by default with Git for Windows. This procedure explains how to set up the OpenSSH client and add your key to its ssh-agent. If you are using Git for Windows, you can also prioritize the native Windows OpenSSH over the Git for Windows SSH agent:

  1. Make sure the OpenSSH Client is installed by searching for it in the Windows Settings Optional features window (Start > Settings, then search for “Optional features”). This applies to Windows 10+.

  2. Check your %PATH% environment variable to make sure the native Windows OpenSSH location appears (for example, C:WINDOWSSystem32OpenSSH).

    Note: If you are already using Git for Windows, make sure the native Windows OpenSSH location appears before the Git for Windows SSH location in your %PATH% variable. This ensures that Windows uses the native Windows OpenSSH agent over the Git for Windows SSH agent.

  3. In a PowerShell terminal, start the ssh-agent process and make sure it starts automatically:

    # Set the ssh-agent service to start automatically and manually start it now
    Get-Service ssh-agent | Set-Service -StartupType Automatic
    # Run the ssh-agent process to start the ssh-agent service
    ssh-agent
    
  4. Import your key into the ssh-agent by running ssh-add on the command line and then following the instructions. By default, the agent adds the %USERPROFILE%.sshid_rsa key and prompts you for the password.

    # Import the key
    ssh-add
    

    To use a different key, you can specify it as an argument:

    # Set the ssh-agent service to start automatically and manually start it now
    ssh-add <your-secure-ssh-key-name>
    

    If you can’t remember the name of your key, you can ask the agent to list them:

    ssh-add -l
    
  5. If you installed Git for Windows, reset the %GIT-SSH% environment variable to make sure that Git always uses the native Windows OpenSSH version of the ssh-agent:

    [Environment]::SetEnvironmentVariable("GIT_SSH", "$((Get-Command ssh).Source)", [System.EnvironmentVariableTarget]::User)
    

Adding SSH keys to your SSH Agent for macOS

Use the ssh-add command to add your SSH keys to the ssh-agent running on your macOS system. The command parameter you use depends on your version of macOS:

  • Prior to macOS 12, use:

    ssh-add -K ~/.ssh/<your-secure-ssh-key-name>
    
  • Starting with macOS 12, use:

    ssh-add --apple-use-keychain ~/.ssh/<your-secure-ssh-key-name>
    

After you run this command, the terminal asks for the password to unlock your SSH key and then adds it to the macOS keychain. However, once you restart your system, every key stored in the ssh-agent is reset.

To prevent re-entering your password after restarting your system, open the ~/.ssh/config file (or create one if you don’t find it), and add the following:

Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/<your-secure-ssh-key-name>

Restart your machine to apply these changes.

Can’t update Git version

If you are trying to update your Git dependencyThe Package Manager retrieves Git dependencies from a Git repository directly rather than from a package registry. Git dependencies use a Git URL reference instead of a version, and there’s no guarantee about the package quality, stability, validity, or even whether the version stated in its package.json file respects Semantic Versioning rules with regards to officially published releases of this package. More info
See in Glossary
to a newer version from the repository, but it’s not working, it’s probably because your Git dependency is locked. If you want to update your Git dependency to a newer version from the repository, use the Add package from git URL button and enter a Git URL. For more information, see Locked Git dependencies.

‘Failed to parse Http response’ in My Assets context

If you see the following message in the Console window when trying to download an Asset Store package, there might be a problem with your Asset Store cache:

[PackageManager] Error Failed to parse response. UnityEditor.AsyncHTTPClient![:D](https://forum.unity.com/styles/default/xenforo/clear.png)one(State, Int32)

To solve this problem, delete all downloaded assets from the Asset Store package directory and then try downloading the assets again.

Warning: If your project contains a lot of asset data, this might take a lot of time and bandwidth to re-download everything.

Missing ‘My Registries’ in the Package Manager window

Not all registry providers are compatible with Unity’s Package Manager. If the package registry server you added does not implement the /-/v1/search or /-/all endpoints, your scoped registry is not compatible with Unity’s Package Manager, and doesn’t appear in the My Registries context in the Package Manager window.

Missing MonoBehaviour errors

While building, if there are a lot of errors about Missing Behavior, the UnityLinker might be mistakenly stripping out a component that it thinks is unreferenced. It often does this because the stripping level is too aggressive. For example, if you have a prefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary
in an AssetBundle that references the SpriteShape component in the 2D SpriteShape package, the object might be missing and might generate compiler warnings.

To fix this, you can either lower the stripping level for the UnityLinker or declare the package’s assemblies inside the link.xml file in order to preserve them from being stripped:

<linker>
    <assembly fullname="Unity.2D.SpriteShape.Runtime" preserve="all"/>
    <assembly fullname="Unity.2D.Common.Runtime" preserve="all"/>
 </linker>

For more information on stripping levels and the UnityLinker, see Managed code stripping.

Loading error for hostfxr.dll on Windows

If the Console reports that the hostfxr.dll library was found, but Unity failed to load it from C:<path_to_app>hostfxr.dll, you can fix this error on Windows 7 or Windows Server 2008 R2 by installing both KB2999226 and KB2533623 patches.

Local folder or tarball paths

  • Community Forums
  • Archive
  • Archive
  • Vuforia 4.0 (Read-Only)
  • Network Connection error in Unity Play Mode

Hello, I’m having the exact same problem as the closed thread regarding Unity Play Mode not being able to connect. My Android device on the same network has no issues, and its a private network with no site blocking and I even tried turning off all firewalls. This happens in an empty scene with just the new camera as well as in fully set up projects. Any help wpuld be appreciated. 

Hello ,

I am having the similar issue. Whenever, I hit the play button in unity editor and also on my android device , I get this error message  «Unable to contact server. Please  try again later» I have checked everything else is working fine, I have checked my internet connection and also I can go to unity store and download the file. So, I dont think the issue is with connection.

I using unity4.6 , vuforia 4.0.5 beta .

Can someone help me please.

Hi all,

Any updates on this? Vuforia in unity insists that there is no internet connection

It’s basically impossible to get any work done. And no, it has nothing to do with the connection on my end

Cheers

im having rly good connection with 100/100 so thats not the problem. :/ 

Open the app with better internet connection for the first time to validate the QCAR License. Next time onwards no need of internet.

vamshi

Offline

Joined:
April 12, 2013

Posts:
75

My Unity version is 4.6.2f1 Pro and the Vuforia version is «vuforia-unity-mobile-android-ios-4-0-103»

In an empty project I just drag de ARCamera and import my target from Vuforia website. I put de License Key and just play the scene and the same problem appears as earlier posts.

Get the error:

QCAR Initialization Error

No network available. Please make sure you are connected to the internet.

any suggestions?

Am having the similar issue. Whenever, I hit the play button in unity editor, I get this annoying error message «Unable to contact server. Please  try again later» I have checked everything else is working fine, I have checked my internet connection and also I can go to unity store adn download the file. So, I dont think the issue is with connection.

Can someone help me please.

Am also facing the same problem without internet for the first time.

my Solution : 

For the first time app should open with better internet connection to validate the license. Once validated, no need of internet. 

vamshi

Offline

Joined:
April 12, 2013

Posts:
75

Any news about the solution of this issue?

Hello for all,

I just found this post with the same problem that I have right now. 

My Unity version is 4.6.2f1 Pro and the Vuforia version is «vuforia-unity-mobile-android-ios-4-0-103»

In an empty project I just drag de ARCamera and import my target from Vuforia website. I put de License Key and just play the scene and the same problem appears.

QCAR Initialization Error

No network available. Please make sure you are connected to the internet.

Of course Unity is connected to internet because I can open the Asset Store inside Unity. So I understand that there is no problem between Unity and any firewall.

I also have check a lot of times that the license key is without any blank space or somehing. I hace copy it using Chrome and IExplorer and paste in Unity editor. The same problem.

I have tried to type manually the license key character by character, but the same problem happens.

Please, could anyone help me?

thank you very much for all

Igor

igorlean

Offline

Joined:
March 17, 2015

Posts:
2

Having the same issue.  Tried all the suggestions below and in other posts on the topic.  What was the solution???

DGBatch

Offline

Joined:
March 19, 2015

Posts:
1

seen and answered, but you should really post that as a public official solution if it works… for now :/

I already read this thread and there’s nothing in there that i didn’t try, of course i checkd for this, i even entered the code manually letter-by-letter, to see if that changed something…

and just for curiosity, i tried this in unity 64bit and it dosn’t have this issue (it validates the code), but of course then vuforia doesn’t work because it only supports unity 32bit

Try to copy the string to a Text editor and verify that you do not have hidden «newline» or «carriage return» characters at the end of the string, as these can have the same effect as «blank» spaces.

Hi,

— I’m using unity 5 32 bit on windows 7

— I’m running vuforia test scene for object recognition (teapots)

— I checked the code a thousand times and it does not contain whitespaces

— I have a working internet connection with no proxies or whatever can bluck the connection, unity is also successfully checking for updates

— I still get the annoying «no network connection» error 

Please help :/

Could you try to deploy and run on device and see if it is Play Mode specific, or happens in device too ?

I’m using Unity 4.6.2f and used Chrome (and IE) to grab the License Key. I haven’t had the chance to deploy to a device yet, so I’m just using Unity. So I guess the time/date issue isn’t the problem. Time and date is fine and I highly doubt that another time zone causes any problems.

Console Output is attached.

Thanks again!

tomwim

Offline

Joined:
February 27, 2015

Posts:
3

Also make sure your device has approximatly the correct time/date.  If this is extremely off, then the SSL verification can fail.

Could you grab the Unity console Logs and paste them here ?

Also, which Unity version are you using ?

and what Web browser you used to display the License Manager page with your Key ?

Thanks for the quick reply.

Unfortunately it still doesn’t work. 
How would you make sure that there is absolutely no unwanted character in the copied license key?

tomwim

Offline

Joined:
February 27, 2015

Posts:
3

Could you try the following:

— close Unity

— remove the /Library folder under your Unity project

— reopen Unity (your project)

— remove the Key from the ARCamera and copy-paste it again (from the License Manager into the ARCamera)

— run ?

Hi,

I’m having the same problem. 
I just downloaded the Vuforia Unity Extension today, so it should be the newest version.

A lot of people with the same issue reported a license key copy problem with blank spaces. I checked for blank spaces, copied it in a text editor to scan for other weird characters but the license key should be fine. I’m also connected to the internet and can access vuforia.com.
I followed the instructions in the closed thead: https://developer.vuforia.com/forum/general-questions/unity-play-mode-network-error
Still the error message: «QCAR Initialization Error. No network available. Please make sure you are connected to the internet.»
I’d really like to make this run so I hope someone can help me!

Thanks in advance

tomwim

Offline

Joined:
February 27, 2015

Posts:
3

Make sure your device/machine has a more or less proper time & date.  If it is several weeks or months off of the true date, the verificaiton of the SSL certificate will fail.  This will present itself as an «unable to connect to server» error.

And what is the error message you get in Play Mode ? 

Is it «No network connection» or «Invalid keys» ?

Hi, would you mind sending me your App name and key via PM ?

Понравилась статья? Поделить с друзьями:
  • Unity native error запрошенная операция требует повышения
  • Unity launcher error
  • Unity launch error unity hub
  • Unity internal error shader
  • Unity hub license error