Failed to parse Packages/manifest.json - c#

I making a game with Unity and I want to add some ADs. I added AdMob and when it shows AD game is crashing. Now I added appodeal and it crashes every time I start app on my android phone, but in playmode in Unity all OK.
In console I got this error:
Failed to parse Packages/manifest.json.
Exception:System.MethodAccessException: Method EDMInternal.MiniJSON.Json.Deserialize(string)' is inaccessible from methodGoogle.PackageManifestModifier.ReadManifest()'
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
at Google.PackageManifestModifier.ReadManifest () [0x00039] in Z:\tmp\tmp.SU4iki1OHB\third_party\unity\unity_jar_resolver\source\PackageManagerResolver\src\PackageManifestModifier.cs:89
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
Google.PackageManifestModifier:ReadManifest() (at Z:/tmp/tmp.SU4iki1OHB/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManifestModifier.cs:91)
Google.PackageManagerResolver:UpdateManifest(ManifestModificationMode, Boolean, Boolean, IEnumerable`1) (at Z:/tmp/tmp.SU4iki1OHB/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManagerResolver.cs:329)
Google.PackageManagerResolver:CheckRegistries() (at Z:/tmp/tmp.SU4iki1OHB/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManagerResolver.cs:117)
Google.PackageManagerResolver:m__0() (at Z:/tmp/tmp.SU4iki1OHB/third_party/unity/unity_jar_resolver/source/PackageManagerResolver/src/PackageManagerResolver.cs:78)
Google.RunOnMainThread:ExecuteNext() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)
Google.RunOnMainThread:m__B() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)
Google.RunOnMainThread:RunAction(Action) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested(Boolean) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Also I got these warnings:
Cannot add menu item 'Assets/External Dependency Manager/Android Resolver/Display Libraries' for method 'PlayServicesResolver.MenuDisplayLibraries' because a menu item with the same name already exists.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Cannot add menu item 'Window/Google/Game Package Registry/Settings' for method 'PackageManagerResolver.ShowSettingsAlias' because a menu item with the same name already exists.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
And 17 warnings like these.
I use this code to show AD in appodeal:
private void Initialize(bool isTesting)
{
Appodeal.setTesting(isTesting);
Appodeal.muteVideosIfCallsMuted(true);
Appodeal.initialize(APP_KEY, Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO);
}
public void ShowInterstitial()
{
if (Appodeal.isLoaded(Appodeal.INTERSTITIAL))
{
Appodeal.show(Appodeal.INTERSTITIAL);
}
}
I don't know what I can do. Help me please.

I know this is a pretty old question, but maybe my solution would be helpful in case someone will face same problem. In my case I had two different versions of ExternalDependencyManager in the project. I checked Assets/ExternalDependencyManager/Editor folder and there were duplicated libraries v1.2.152 and v1.2.150. I removed all files with v1.2.150 version and error had gone.

Related

UrlProcessor warning for unity with Ready Player Me SDK during runtime

I tried to load Avatar imported from Ready Player Me package via URL during runtime, but I got below warning and my project stopped after this, can anyone give an explanation why I get below warnings? I just use the Ready Player Me runtime script as the official manual told.
UrlProcessor.CreateFromUrl: LocalDirectory for local paths is not set. Defaulting to EditorDefaultLocalDirectory
UnityEngine.Debug:LogWarning (object)
ReadyPlayerMe.UrlProcessor:CreateFromUrl (string) (at Assets/Plugins/Ready Player Me/Runtime/Operations/UrlProcessor.cs:49)
ReadyPlayerMe.UrlProcessor:Create (string) (at Assets/Plugins/Ready Player Me/Runtime/Operations/UrlProcessor.cs:36)
ReadyPlayerMe.AvatarLoader:ProcessUrl (string) (at Assets/Plugins/Ready Player Me/Runtime/AvatarLoader.cs:78)
ReadyPlayerMe.AvatarLoader:LoadAvatar (string) (at Assets/Plugins/Ready Player Me/Runtime/AvatarLoader.cs:49)
Runtime:LoadAvatar () (at Assets/Scripts/Runtime.cs:27)
Runtime:Start () (at Assets/Scripts/Runtime.cs:16)
the url processor method changed, upload the ready player me sdk to solve

DllNotFoundException when calling my CloudXR Android plugin from Unity

I am creating an Android plugin to be used by Unity. However, I get a DLLNotFoundException when I try calling the plugin from Unity. Here are the steps I took:
Android Studio
I have generated an AAR plugin from the hello_cloudxr_c sample Android project which uses CloudXR version 3.2. This can be downloaded here: hello_cloudxr_c on GitHub. The only modifications I did to this to generate the AAR were in build.gradle (:app) where I changed the first line to apply plugin: ‘com.android.library’ and commented out applicationId “com.nvidia.ar.hellocloudxr” in the defaultConfig block.
I changed the path of -DARCORE_INCLUDE from ${project.rootDir}/…/…/libraries/include" to ${project.rootDir}/libraries/include"
I changed the path of -DGLM_INCLUDE from ${project.rootDir}/…/…/libraries/glm" to ${project.rootDir}/libraries/glm"
minSdkVersion is set to 25 and targetSDKVersion is 28.
In jni_interface.cc, I added a small function called getSomeNumber() which returns an integer.
extern "C" {
int getSomeNumber() {
return 2345;
}
}
I will call this from Unity as a simple test.
After doing a clean build, app-debug.aar is created in app/build/outputs/aar. If I change the file extension to .zip, uncompress it and look in app-debug/jni/arm64-v8a, I see that only libc++_shared.so, libhello_cloudxr_native.so and liboboe.so are present. The CloudXR library isn’t there. I manually copy libCloudXRClient.so, libgrid.so, libGsAudioWebRTC.so and libPoco.so into the jniLibs folder in Android Studio. When I build again, all the required .so files are present in the AAR.
Unity
I have created a Unity project which has a scene containing a single button. The AAR file is copied into the Plugins folder. I have written a script called CXRConnect.cs which references the plugin and calls the getSomeNumber() function when the button is pressed.
public class CXRConnect : MonoBehaviour
{
public Button button;
public Text textObject;
private const string LIBRARY_NAME = "libhello_cloudxr_native";
[DllImport(LIBRARY_NAME)]
private static extern int getSomeNumber();
void Start()
{
Button btn = button.GetComponent<Button>();
btn.onClick.AddListener(CallCPPLibrary);
}
void CallCPPLibrary()
{
int num = getSomeNumber();
Debug.Log("CXR Some Num: "+num);
textObject.text = num.ToString();
}
}
In the Unity project settings:
Minimum API Level is set to Android 10.0 (API level 29)
Target API Level is set to Automatic (highest installed)
Scripting Backend is IL2CPP
Api Compatibility Level is .NET Standard 2.0
ARMv7 and ARM64 are ticked in Target Architectures
I am running the build on a Samsung Galaxy Note20 Ultra. When the app is running on the device and I press the button in the Unity scene, there is an error in Logcat in Android Studio which reads:
2022-07-06 10:59:42.240 3203-18112/? E/Unity: DllNotFoundException: Unable to load DLL 'hello_cloudxr_native': The specified module could not be found.
at CXRConnect.getSomeNumber () [0x00000] in <00000000000000000000000000000000>:0
at CXRConnect.CallCPPLibrary () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (T1 handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData p
Have any of you encountered this issue? What could be the possible cause and how should I fix it? I have checked the contents of the plugin and all the required libraries are in there.

Pointer Error when using GGVPointer on MRTK canvas Unity

I am attempting to build a world space canvas that is useable with the Hololens 2 in Unity. Whenever I activate the pointer hand I am receiving this error:
The pointer you are trying to remove does not exist in the mapping dict!
MixedRealityInputModule.cs
I have spent several hours fiddling with the input profiles and searching the web to no avail. If you have experienced this issue or have any idea of what is causing this please let me know. Thanks for your time.
p.s stack trace is posted below:
The pointer you are trying to remove does not exist in the mapping dict!
UnityEngine.Debug:LogError (object)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputModule:Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler.OnSourceLost (Microsoft.MixedReality.Toolkit.Input.SourceStateEventData) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputModule.cs:433)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem/<>c:<.cctor>b__246_1 (Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler,UnityEngine.EventSystems.BaseEventData) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputSystem.cs:970)
UnityEngine.EventSystems.ExecuteEvents:ExecuteHierarchy<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler> (UnityEngine.GameObject,UnityEngine.EventSystems.BaseEventData,UnityEngine.EventSystems.ExecuteEvents/EventFunction1<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler>) Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:DispatchEventToObjectFocusedByPointer<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler> (Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer,Microsoft.MixedReality.Toolkit.Input.BaseInputEventData,bool,UnityEngine.EventSystems.ExecuteEvents/EventFunction1<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler>) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputSystem.cs:703)
Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:HandleEvent<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler> (UnityEngine.EventSystems.BaseEventData,UnityEngine.EventSystems.ExecuteEvents/EventFunction1<Microsoft.MixedReality.Toolkit.Input.IMixedRealitySourceStateHandler>) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputSystem.cs:471) Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:RaiseSourceLost (Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource,Microsoft.MixedReality.Toolkit.Input.IMixedRealityController) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputSystem.cs:960) Microsoft.MixedReality.Toolkit.Input.BaseInputSimulationService:RemoveControllerDevice (Microsoft.MixedReality.Toolkit.Utilities.Handedness) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Providers/InputSimulation/BaseInputSimulationService.cs:178) Microsoft.MixedReality.Toolkit.Input.BaseInputSimulationService:UpdateControllerDevice (Microsoft.MixedReality.Toolkit.Input.ControllerSimulationMode,Microsoft.MixedReality.Toolkit.Utilities.Handedness,object) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Providers/InputSimulation/BaseInputSimulationService.cs:88) Microsoft.MixedReality.Toolkit.Input.InputSimulationService:LateUpdate () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Providers/InputSimulation/InputSimulationService.cs:390) Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:LateUpdate () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Services/BaseDataProviderAccessCoreSystem.cs:67) Microsoft.MixedReality.Toolkit.Input.MixedRealityInputSystem:LateUpdate () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Services/InputSystem/MixedRealityInputSystem.cs:273) Microsoft.MixedReality.Toolkit.MixedRealityToolkit/<>c:<LateUpdateAllServices>b__74_0 (Microsoft.MixedReality.Toolkit.IMixedRealityService) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Services/MixedRealityToolkit.cs:1074) Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder (System.Action1<Microsoft.MixedReality.Toolkit.IMixedRealityService>) (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Services/MixedRealityToolkit.cs:1148)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:LateUpdateAllServices () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Services/MixedRealityToolkit.cs:1074)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:LateUpdate () (at Library/PackageCache/com.microsoft.mixedreality.toolkit.foundation#251fc689f36f/Core/Services/MixedRealityToolkit.cs:738)

Failed to update Android SDK package list

Everytime I try to open the Player settings, it will show only blank. And the error below will be shown in the console.
I have tried to follow this link: https://answers.unity.com/questions/1320634/unable-to-list-target-platforms-when-i-try-to-buil.html
But still didn't work.
CommandInvokationFailure: Failed to update Android SDK package list.
/Applications/Unity/Hub/Editor/2019.2.0b1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list
stderr[
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:103)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 4 more
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.SDKManager.UpdatePackagesList () (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager+Component tool) (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.AndroidPlatformIconProvider.GetCurrentSetAndroidSDKVersion () (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.AndroidPlatformIconProvider.UpdateSDKVersion () (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.AndroidPlatformIconProvider.get_targetSDKSupportsAdaptiveIcons () (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.Android.PlayerSettingsEditorExtension.IconSectionGUI () (at <4e05d4950c734693b0d63f05223d7a90>:0)
UnityEditor.PlayerSettingsEditor.IconSectionGUI (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.Modules.ISettingEditorExtension settingsExtension, System.Int32 sectionIndex) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/PlayerSettingsEditor/PlayerSettingsEditor.cs:803)
UnityEditor.PlayerSettingsEditor.OnInspectorGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/PlayerSettingsEditor/PlayerSettingsEditor.cs:573)
UnityEditor.AssetSettingsProvider.OnGUI (System.String searchContext) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Settings/Providers/AssetSettingsProvider.cs:94)
UnityEditor.SettingsWindow.DrawControls () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:322)
UnityEditor.SettingsWindow.DrawSettingsPanel () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:313)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Before, I can see some options so that I can try to build.
I was having this issue as well. Nothing worked until I did this:
Go Unity > Preferences, select External Tools, deselect everything
Close the Editor
Open the Editor, re-enable everything you deselected
Hit Play to force a refresh
Then build again and it'll work
I got the same error and fixed it in a different way.
Possible fix here Failed to update Android SDK Package List
I got the same error after importing the firebase SDK into Unity 2021.3.3f1. It turned out my system variable JAVA_HOME was not pointing to the Java used by Unity (which apparantly only caused a problem in combination with firebase).
To solve it I had to
change Windows 10 -> Settings -> System -> Edit System variables
Change the value of "JAVA_HOME" to my Unity Java version: "F:\Programs\Unity\2021.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK"
Reboot my Computer (for the JAVA_HOME change to take effect)
In Unity: Click on Assets -> External Dependency Manager -> Android -> Resolve
Not sure if the last step was necessary. I tried a lot of things (including "regenerating project files" - from Unitys settings)

Unity Watson SDK error on Speech to Text Example

I'm trying to run the newest Unity Watson SDK from GitHub. Whenever I try to play the example scene for speech to text, I get this error. I have the API key set and my region is US-Dallas, but I don't think it's related to the problem.
I'm building an app for Android that utilizes speech to text. I've tried looking this up for hours, but I can't find a solution. I've tried re-downloading the SDK but nothing changed.
[02/03/2019 00:54:42][Unity][CRITICAL] Unity Exception
ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length : System.String.Substring (System.Int32
startIndex, System.Int32 length) (at
<f2e6809acb14476a81f399aeb800f8f2>:0)
IBM.Watson.DeveloperCloud.Connection.RESTConnector.AddHeaders
(System.Collections.Generic.Dictionary`2[TKey,TValue] headers)
(at Assets/unity-sdk-
2.14.0/Scripts/Connection/RESTConnector.cs:380)
IBM.Watson.DeveloperCloud.Connection.RESTConnector+
<ProcessRequestQueue>c__Iterator0.MoveNext () (at Assets/unity-sdk-
2.14.0/Scripts/Connection/RESTConnector.cs:470)
IBM.Watson.DeveloperCloud.Utilities.Runnable+Routine.MoveNext ()
(at Assets/unity-sdk-2.14.0/Scripts/Utilities/Runnable.cs:131)
UnityEngine.SetupCoroutine.InvokeMoveNext
(System.Collections.IEnumerator enumerator, System.IntPtr
returnValueAddress)
(at
/Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.Debug:LogError(Object)
IBM.Watson.DeveloperCloud.Debug.DebugReactor:ProcessLog(LogRecord)
(at Assets/unity-sdk-2.14.0/Scripts/Debug/DebugReactor.cs:60)
IBM.Watson.DeveloperCloud.Logging.LogSystem:ProcessLog(LogRecord)
(at Assets/unity-sdk-2.14.0/Scripts/Logging/Logger.cs:206)
IBM.Watson.DeveloperCloud.Logging.Log:Critical(String, String,
Object[]) (at Assets/unity-sdk-2.14.0/Scripts/Logging/Logger.cs:294)
IBM.Watson.DeveloperCloud.Logging.LogSystem:UnityLogCallback(String,
String, LogType) (at Assets/unity-sdk-
2.14.0/Scripts/Logging/Logger.cs:167)
UnityEngine.Application:CallLogCallback(String, String, LogType,
Boolean)
I know the scene is supposed to output what it thinks I am saying, but nothing is happening. Any help would be appreciated!

Categories