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

firebase-core-9.6.1 .aar file build failure #19

Closed
rad-ed opened this issue Oct 23, 2016 · 27 comments
Closed

firebase-core-9.6.1 .aar file build failure #19

rad-ed opened this issue Oct 23, 2016 · 27 comments

Comments

@rad-ed
Copy link

rad-ed commented Oct 23, 2016

error

The aar file generated by the resolver for firebase-core 9.6.1 appear to be missing the class.jar file associated with it; that, or unity is expecting a classes.jar file, where none exists.

@brianjkd
Copy link

I have this issue as well.

@BakshishSingh
Copy link

I too have the same issue. Any solutions to it yet ?

@brianjkd
Copy link

I found that it crashes because Unity expects all .aar files to contain a .jar. So, a workaround is to create an empty .jar and add it to each of the failing .aar files.

@rad-ed
Copy link
Author

rad-ed commented Oct 29, 2016

The jar resolver simply updates the file at that point, however.

@rad-ed
Copy link
Author

rad-ed commented Oct 29, 2016

I managed to get a build to complete by making two .jar files with the necessary META-INF etc, but Unity still does not cooperate with the fireBase connection. Have you had any luck? If a fix is known, I might be able to write a patch.

@stewartmiles
Copy link
Contributor

Is this still an issue with Firebase 9.8 on Android?

@stewartmiles
Copy link
Contributor

This is no longer an issue with the latest release firebase aars.

@smholsen
Copy link

smholsen commented Sep 9, 2017

I am currently having this issue with firebase-core-11.2.0.
The jars are simply not generated in the Temp/ folder during build. Does anyone know how to fix this issue?

@johnb003
Copy link
Contributor

johnb003 commented Sep 9, 2017

The aars are not to spec. I thought we did something to patch them, you can try force explode in the settings, or give Gradle prebuild a try (also in the Android resolver settings), which will replace all of the aars with a single combined one, which will have the classes.jar

@johnb003
Copy link
Contributor

johnb003 commented Sep 9, 2017

It sounds like this is not resolved after all. Reopening.

@johnb003 johnb003 reopened this Sep 9, 2017
@johnb003
Copy link
Contributor

johnb003 commented Sep 9, 2017

I cannot reproduce this problem.
We do have code that automatically causes aars that don't have a classes.jar to get expanded.

smholsen, the new version uses gradle to fetch and copy the aars, so what we do in the Temp folder shouldn't be a concern. We do post process the files we copy using gradle, and make sure they are not malformed.

See: a998e63

Can you provide more info on your current setup?
What version of Unity are you using?
Which version of the plugin are you using?
Are you using Windows, or Mac?

What files do you see in Assets/Plugins/Android?
Specifically, does "firebase-core-11.2.0" get expanded to a folder, or is it still a file ".aar"?
You should also note that every file or folder in this directory and managed by this plugin, should have an asset label "Gpsr".

Can you show a snapshot of your settings:
image

@smholsen
Copy link

smholsen commented Sep 9, 2017

Thank you very much for looking into this. I want to add that I am very new to development with unity, so this is most likely me doing something wrong :)

I am currently using Unity 2017.1.0f3 (64 bit)
I am not sure which plugin you are referring to, I am using the Firebase Unity SDK version 4.1.0.
I am on Windows 10 Pro 64-bit.
I have attached a screenshot of the contents of the Assets/Plugins/Android folder. It seems to me that the .aar does not get expanded.
I am not sure how I can see the asset labels of the assets in my project, so I am not sure about the "Gpsr" labels.
Attatched is also a snapshot of my Settings.

image
image

image

edit: I can also add that I got the same error when trying with Force Gradle Prebuild.

@johnb003
Copy link
Contributor

johnb003 commented Sep 9, 2017 via email

@smholsen
Copy link

smholsen commented Sep 9, 2017

Using Unity's search function in my project by label, nothing is found when I search for Gpsr. Is this something I must add manually?
When running resolution I cannot see any errors. I simply get the confirmation box "Resolution Complete".
Note: This is only when "Prebuild With Gradle" is not checked. If "Prebuild With Gradle" is checked, and I click "Force Resolve Client Jars", then I get the error "Resolution Failed".

The following zip file contains the Editor.log file, after running a force resolution with "Prebuild With Gradle" NOT checked.
Editor.zip

@stewartmiles
Copy link
Contributor

Hi @smholsen, in the log you shared it looks like resolution succeeded. When you disable "prebuild with Gradle" and run "Force Resolve Client Jars" does this correctly explode the firebase-core, firebase-common and other AARs ?

@smholsen
Copy link

Hi!
I am sorry, but I am not sure how I can verify that. How can I find that out?

@stewartmiles
Copy link
Contributor

  • Select the "Assets > Play Services Resolver > Android Resolver > Settings" menu item
  • Uncheck, Prebuild with Gradle
  • Check, Fetch Dependencies with Gradle
  • Check, Enable auto-resolution
  • Check, Install Android packages
  • Check, Explode AARs
  • Check, Verbose logging (we may need the logs)
  • Click "OK"
  • Select the "Assets > Play Services Resolver > Android Resolver > Force Resolver Client Jars" menu item.
  • Wait for spinner (bottom right of the editor window) to finish
  • Under Assets/Plugins/Android you should see folders for exploded AARs (e.g firebase-core, firebase-common, firebase-idd).

@smholsen
Copy link

Thank you very much for the instructions.
After clicking the "Force Resolver Client Jars" option, I instantly receive the "Resolution Complete" dialog box.
It does not seem to exist folders for the exploded AARs. (only the .aar files).

I have attached the log file, aswell as a txt file listing all the content of the Assets/Plugin/Android folder. Please let me know if there is anything more I can do.

logAndContent.zip

@johnb003
Copy link
Contributor

Yes, one more thing to try...
Even a normal resolution can run fairly quickly.

Try deleting the firebase related aars in Assets/Plugins/Android. From the looks of it, not all of your aars there are from firebase and it's dependencies, so be selective.

Based on the image presented above, you should be able to remove these:

Firebase* (except not the folder, just the AARs and meta files).
play-services*
support-*

Then try force resolution again, which will add the files back, and should expand the malformed ones.

@smholsen
Copy link

Thank you again very much. The issue was resolved after deleting the existing (and probably corrupt) relevant .aar's in the Assets/Plugins/Android folder, and then running Force Resolution.

@johnb003
Copy link
Contributor

johnb003 commented Sep 12, 2017

I incidentally ended up reproducing this issue today.
There was a race condition in loading the plugin, and triggering a resolution, which could result in Unity freezing during resolution.

This would copy the files, but never complete, so we'd never get a chance to tag the assets or explode them.

This then causes all future resolutions (even force ones) to fail, because the dependency is already present and untagged (indicating that it's a dependency our plugin is allowed to touch).

There's already a fix for this, so if anyone else sees this, grab the latest plugin from this repository.

Then delete the files in Assets/Plugins/Android/:
Firebase* (except not the folder, just the AARs and meta files).
play-services*
support-*

And then force resolve.

@andrew-grischenko
Copy link

@czater The fix mentioned by @duchanhleo 4 posts above didn't work for me until I completely cleaned up my Unity project from all plugins, leaving only my own assets. After I reinstalled the Firebase & AdMob then I ran into another issue, described and resolved here #19.

After it worked and I got again to the problem discussed here and followed the advice from @duchanhleo - it worked! The package builds now, HOWEVER now I face the issue described here: https://stackoverflow.com/questions/46338487/unity-firebase-fails-on-load-failed-to-read-firebase-options-from-the-apps-re

That question is 4 days old and has no answer yet...

@thesayat
Copy link

@andrew-grischenko same here, but i've found solution!
In my case i've got FireBaseDataBase module.
Same issue as in topic, cannot replace file.
Here's my solution:

  1. Create new project
  2. Add FireBase package, configure all the settings as you wanted to have in your project
  3. From this new project copy from Assets/Plugins/Android/ these files:
  • Firebase*
  • play-services*
  • support-*
  1. Replace these copied files in your current project
    It works for me, i hope not only for me.

@andrew-grischenko
Copy link

Thank you, @dsiemienik
I solved it but removing all plugins and re-importing from scratch.

@AxisTB
Copy link

AxisTB commented Jan 13, 2018

Hello, I currently have this issue. I tried multiple potential solutions mentioned here, but nothing worked. Even when creating a new project, adding the Firebase unitypackage to the project which already contains the resolver dlls (tried using this repo as well) and then trying to build on android will end up having the moving file error.

I have another error which might be related when the relover finish resolving(the .aar files are created):

IOException: Directory ...\AppData\Local\Temp\k9ykn5id.tx8 (changes every time) is not empty
System.IO.Directory.Delete (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:178)
Google.FileUtils.DeleteExistingFileOrDirectory (System.String path, Boolean includeMetaFiles)
GooglePlayServices.ResolverVer1_1.ShouldExplode (System.String aarPath)
GooglePlayServices.ResolverVer1_1+c__AnonStorey14.<>m__1F (GooglePlayServices.Result result)
GooglePlayServices.ResolverVer1_1+c__AnonStorey14+c__AnonStorey15.<>m__28 ()
GooglePlayServices.PlayServicesResolver.PumpUpdateQueue ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)

I'm using Unity 5.6.1f1 and on Windows 7 (will try on Windows 10 next Monday)

@stewartmiles
Copy link
Contributor

@AxisTB it almost sounds like something is preventing the temporary files from being deleted, perhaps an anti-virus program?

@AxisTB
Copy link

AxisTB commented Jan 13, 2018

Hmm... Could be possible, I will try disabling whatever A-V is installed on this computer.

Edit: Well damn, that was it. Thanks a lot.

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

No branches or pull requests

9 participants