google / play-unity-plugins

The Google Play Plugins for Unity provide C# APIs for accessing various Play services
Other
425 stars 109 forks source link

DirectoryNotFoundException error on opening "Google" --> "Play Billing" --> "Build Settings..." window #110

Open E-Reg opened 3 years ago

E-Reg commented 3 years ago

Play-unity-plugins 1.4.0 Unity 2020.3.9f1 .NET 4.x IL2CPP Unity IAP Version 3.2.1 Also included: dependencies { implementation 'com.google.android.gms:play-services-ads:19.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7 implementation 'com.google.android.gms:play-services-base:17.6.0' // Assets/Firebase/Editor/AppDependencies.xml:17 implementation 'com.google.firebase:firebase-analytics:18.0.2' // Assets/Firebase/Editor/MessagingDependencies.xml:15 implementation 'com.google.firebase:firebase-app-unity:7.1.0' // Assets/Firebase/Editor/AppDependencies.xml:22 implementation 'com.google.firebase:firebase-auth:20.0.2' // Assets/Firebase/Editor/AuthDependencies.xml:13 implementation 'com.google.firebase:firebase-auth-unity:7.1.0' // Assets/Firebase/Editor/AuthDependencies.xml:20 implementation 'com.google.firebase:firebase-common:19.5.0' // Assets/Firebase/Editor/AppDependencies.xml:13 implementation 'com.google.firebase:firebase-crashlytics:17.3.1' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:13 implementation 'com.google.firebase:firebase-crashlytics-unity:7.1.0' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:20 implementation 'com.google.firebase:firebase-messaging:21.0.1' // Assets/Firebase/Editor/MessagingDependencies.xml:13 implementation 'com.google.firebase:firebase-messaging-unity:7.1.0' // Assets/Firebase/Editor/MessagingDependencies.xml:20 } Use jetifier and patch gradleTemplate / AndroidManifest / maintemplate is enabled, using Minify R8 is disabled.

Following https://developer.android.com/google/play/billing/unity:

DirectoryNotFoundException: Could not find a part of the path 'C:\xxx\Assets\Plugins\UnityPurchasing\Bin\Android'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.GetFiles (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Google.Play.Billing.Editor.GooglePlayBillingBuildHelper.GetConflictingGooglePlayBillingAarFileName () (at Assets/GooglePlayPlugins/com.google.play.billing/Editor/Scripts/GooglePlayBillingBuildHelper.cs:83)
Google.Play.Billing.Editor.GooglePlayBillingBuildHelper.HasConflictingGooglePlayBillingAarFile () (at Assets/GooglePlayPlugins/com.google.play.billing/Editor/Scripts/GooglePlayBillingBuildHelper.cs:75)
Google.Play.Billing.Editor.GooglePlayBillingBuildHelper.HasConflictingGoogleAarFile () (at Assets/GooglePlayPlugins/com.google.play.billing/Editor/Scripts/GooglePlayBillingBuildHelper.cs:58)
Google.Play.Billing.Editor.GooglePlayBillingBuildSettings.AddOptionForConflictingAarFile () (at Assets/GooglePlayPlugins/com.google.play.billing/Editor/Scripts/GooglePlayBillingBuildSettings.cs:62)
Google.Play.Billing.Editor.GooglePlayBillingBuildSettings.OnGUI () (at Assets/GooglePlayPlugins/com.google.play.billing/Editor/Scripts/GooglePlayBillingBuildSettings.cs:55)
UnityEditor.HostView.OldOnGUI () (at <9540aba417024bb296674f70fa788b73>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <1fd6bc3af931450b977286a218b046fb>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <1fd6bc3af931450b977286a218b046fb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <6ddf8eac3856492ab1b8cf42618915cc>:0)

A folder exists in given folder "UnityPurchasing~" (can't reconstruct after deleting it)

E-Reg commented 3 years ago

The UNITY_PURCHASING define somehow is disabled but UNITY IAP is not. I will check if this circumstance is related to the error.

Edit: it is not.

MagicMiikka commented 3 years ago

We worked around this by embedding the Unity IAP package and changing the hardcoded Unity IAP path of GooglePlayBillingBuildHelper to private const string UnityIapGoogleAndroidAarPath = "Packages/com.unity.purchasing@3.2.1/Plugins/UnityPurchasing/Android";

E-Reg commented 3 years ago

We worked around this by embedding the Unity IAP package and changing the hardcoded Unity IAP path of GooglePlayBillingBuildHelper to private const string UnityIapGoogleAndroidAarPath = "Packages/com.unity.purchasing@3.2.1/Plugins/UnityPurchasing/Android";

Thank you, @MagicMiikka. Using the path "Library/PackageCache/com.unity.purchasing@3.2.1/Plugins/UnityPurchasing/Android" indeed made the window appear and let me use the fix button, but the build process afterwards still exits with Execution failed for task ':launcher:checkReleaseDuplicateClasses'.