Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundException: Could not load file or assembly. #1087

Closed
Lightone opened this issue Apr 6, 2016 · 9 comments
Closed

FileNotFoundException: Could not load file or assembly. #1087

Lightone opened this issue Apr 6, 2016 · 9 comments

Comments

@Lightone
Copy link

Lightone commented Apr 6, 2016

have a project with Ads admob and google analityc and import the last version of Google play puglin and appear this error (only happend when import for firts time) and the rest of the time work fine.

Unity 5.3 with mono (Android)

The error log

FileNotFoundException: Could not load file or assembly 'GooglePlayServices' or one of its dependencies. The system cannot find the file specified.
System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/AppDomain.cs:746)
System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/AppDomain.cs:733)
(wrapper remoting-invoke-with-check) System.AppDomain:Load (string,System.Security.Policy.Evidence)
System.Reflection.Assembly.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:584)
System.Activator.CreateInstance (System.String assemblyName, System.String typeName, Boolean ignoreCase, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Security.Policy.Evidence securityInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Activator.cs:170)
System.Activator.CreateInstance (System.String assemblyName, System.String typeName, System.Object[] activationAttributes) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Activator.cs:158)
System.Activator.CreateInstance (System.String assemblyName, System.String typeName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Activator.cs:150)
GooglePlayServices.PlayServicesResolver.get_Resolver () (at Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs:96)
GooglePlayServices.PlayServicesResolver.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs:115)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
UnityEditor.AssetDatabase:Refresh()
GooglePlayGames.Editor.GPGSUpgrader:.cctor() (at Assets/GooglePlayGames/Editor/GPGSUpgrader.cs:107)
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])

@claywilkinson
Copy link

This is fixed in a more recent version of the GPGS plugin.

It's a 1 line fix, change Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs, delete lines 96-98 and replace them with
_resolver = Activator.CreateInstance("GooglePlayServices", CurrentResolverName) as IResolver;

See the diff for an exact description of the change: googlesamples/unity-jar-resolver@63eb8ea#diff-86926bc483f4ac58a029a8a416af2ba6R96

@Lightone
Copy link
Author

Lightone commented Apr 6, 2016

the lines 96-98 of me PlayServicesResolver look like this,i dont touch anything.

static IResolver Resolver
{
get
{
if (_resolver == null)
{
// create the latest resolver known.
_resolver = Activator.CreateInstance("GooglePlayServices", CurrentResolverName) as IResolver;
}
return _resolver;
}
}

@claywilkinson
Copy link

Hmm - do you have multiple copies of any files in that directory?

@Lightone
Copy link
Author

Lightone commented Apr 7, 2016

Nop, only one, now is fixed i do the options Resolve clients Jars and now appear the log about the resolve when edit something in the class i have implemented the GPGS and the google play service is running fine and thanks for your help 👍 .

Assets/Incoding/MenuManager.cs imported, resolving play-services
UnityEngine.Debug:Log(Object)
GooglePlayServices.DefaultResolver:ShouldAutoResolve(String[], String[], String[], String[]) (at Assets/PlayServicesResolver/Editor/DefaultResolver.cs:94)
GooglePlayServices.PlayServicesResolver:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs:115)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

Android Jar Dependencies: Resolution Complete
UnityEngine.Debug:Log(Object)
GooglePlayServices.PlayServicesResolver:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/PlayServicesResolver/Editor/PlayServicesResolver.cs:126)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

@claywilkinson
Copy link

Great! glad you got it working.

@DilaraAlbayrak
Copy link

i've exactly the same problem, @Lightone i cannot understand your solution, can you re-explain?

@Lightone
Copy link
Author

Click right in your asset folde space, some menu appear (look like this) and search for google play service and click and check setting and you have select background resolution enable and click on resolver client jars is your have something not update with google play some pop up appear (two options appear) keep the version and update, click in update and wait the process finish and that all, some log appear in unity console when the process completed, that all i do

@DilaraAlbayrak
Copy link

Thanks for your explanation. When i clicked resolve client jars, pop up did not show me two options, it just directly said "Resolution Complete" but it worked!

@chrisError
Copy link

@Lightone you are a Saint I tell you, A SAINT!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants