[Unity3D-Android] Missing libApp.so

3,171 views
Skip to first unread message

Filipe Abrantes

unread,
Feb 26, 2017, 4:55:32 PM2/26/17
to Firebase Google Group
Whenever I try to use any of the classes of the Firebase SDK I get following error output on logcat:

02-27 01:52:11.418 16130 16156 I Unity   : DllNotFoundException: App

02-27 01:52:11.418 16130 16156 I Unity   :   at (wrapper managed-to-native) Firebase.AppUtilPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_AppUtil (Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)

02-27 01:52:11.418 16130 16156 I Unity   :   at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <filename unknown>:0 

02-27 01:52:11.418 16130 16156 I Unity   : Rethrow as TypeInitializationException: An exception was thrown by the type initializer for SWIGExcepti


Im using the latest unity firebase plugin package, unity 5.5.2f1, play services 10.2.0, have the app setup in the firebase console and testing on a Nexus 5 with stock Marshmallow. Did anyone else ran into the same issue? Any ideas of what I might be doing wrong?

Thanks

Stewart Miles

unread,
Feb 28, 2017, 4:48:20 PM2/28/17
to fireba...@googlegroups.com
You're missing the Android dependencies see my response to https://github.com/firebase/quickstart-unity/issues/53

Cheers,
Stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/2dc0e2d1-ef35-4d95-8b37-4358db13fb1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ian Lipták

unread,
Mar 3, 2017, 11:48:04 AM3/3/17
to Firebase Google Group

I have the same issue with latest firebase 3.0.0  plugin for unity, it does not happened before. And it only happen when building configuration is set to ARMv7 devices.  When I change build settings to ARMv7+x86 the problem disappear..


- unity 5.5.2f1, play services 10.2.0 building with gradle build system. 

I think that lib app is not correctly linked but do not know where.. Can anybody help?




Dňa nedeľa, 26. februára 2017 22:55:32 UTC+1 Filipe Abrantes napísal(-a):

Stewart Miles

unread,
Mar 3, 2017, 11:57:39 AM3/3/17
to fireba...@googlegroups.com
Which version of Unity are you using?  Also, do you have auto resolution enabled, under the "Assets > Play Services Resolver > Android Resolver > Settings" menu option?

When a single target ABI (e.g ARMv7) we unpack the AARs (Android dependencies) referenced by the project and strip all x86 binaries from them.  This happens either if you have auto-resolution of Android dependencies enabled in the "Play Services Resolver" or if you select "Assets > Play Services Resolver > Android Resolver > Resolve Client Jars".

This is what ends up in Plugins/Android after resolution when targeting ARMv7 & x86



If you target just ARMv7 you should see the following in Plugins/Android



Notice in the ARMv7 only case, we're only including binaries for that architecture.

Cheers,
Stewart


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

Ian Lipták

unread,
Mar 6, 2017, 9:58:43 AM3/6/17
to Firebase Google Group
Hi Stewart,
I am using latest Unity 5.5.2f1 and auto resolution is enabled. I think that every library is included.



And this exception happens on my android device nexus7 and unity freeze afterwards




It happens when checking dependencies   m_dependencyStatus = FirebaseApp.CheckDependencies();

I think it maybe needs  this librabry or something: (but I dont know how it works) and it is not included whnen building only for armv7


Thank you for your your help.

--jl


Dňa piatok, 3. marca 2017 17:57:39 UTC+1 Stewart Miles napísal(-a):
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3
Auto Generated Inline Image 4

Stewart Miles

unread,
Mar 6, 2017, 12:08:24 PM3/6/17
to fireba...@googlegroups.com
Are you seeing the same problem when building the quickstart samples?


Could you share the file contents of the APK with us?

unzip -l path_to_your_apk

The APK should contain libs/armeabi-v7a/libApp.so among other shared libraries.

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Ian Lipták

unread,
Mar 7, 2017, 10:19:46 AM3/7/17
to Firebase Google Group
Hi Stewart,
It does not include the libApp.so in the testapp either.

Here you can see included libs when building FAT

and here with this build settings:


I don't know where is the problem :(

--jl




Dňa pondelok, 6. marca 2017 18:08:24 UTC+1 Stewart Miles napísal(-a):
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3

Stewart Miles

unread,
Mar 7, 2017, 10:18:13 PM3/7/17
to fireba...@googlegroups.com
Hmm, this makes me wonder whether you have an old version of the Play Services Resolver in your project.  Could you try deleting the Assets/PlayServicesResolver directory and re-importing the feature plugin you're using (they all include this common component).

We added support for unpacking AARs when shared libraries that support multiple ABIs are present and including just the shared libraries for the target ABI.

I've attached our Firebase Analytics project which contains a couple of apks that were built for x86 and armv7, both include the shared libraries for just the target ABI and run as expected.
Could you try out this project to see whether it works for you?  If not, sort of things we need to look at to figure out what's going on with your environment:
  • Unity version (exact version, pro etc.)
  • Operating system
  • Other plugins in your project (if any)
  • Build configs that work vs those that fail
  • Sample project - if you can share one.
Cheers,
Stewart


To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Ian Lipták

unread,
Mar 8, 2017, 10:01:09 AM3/8/17
to Firebase Google Group
After long time I was not able to make gradle to include .so files into apk :) I am too stupid for this..
As workaround I have created folder lib/armabi-v7a

added every .so library I need into it. and zipped it to firebase.zip   then renamed from firebase.zip to firebase.jar
when I add firebase.jar librabry into Plugins/Android folder everthing is packed into apk correctly :)
--jl



Dňa streda, 8. marca 2017 4:18:13 UTC+1 Stewart Miles napísal(-a):
Auto Generated Inline Image 1

Ian Lipták

unread,
Mar 8, 2017, 10:01:15 AM3/8/17
to Firebase Google Group
It was tested on fresh quicstart analytics app downloaded from https://github.com/firebase/quickstart-unity/tree/master/analytics/testapp
and I imported latest firebase version https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_3.0.0.zip
I have everything updated in sdk manager as you can see here

I think play services resolver works correctly, I have deleted it, reimported, resolved manualny several times in the process of testing.. this is how looks my plugins/android folder:

and this is .apk\lib folder after building armv7 only



Today I have downloaded your project "analytics_testapp.zip", there was firebase included so I did not import it again.
This is how look my Plugins/Android folder after play services resolver resolved client jars

I have spotted there is different folder structure in your project.  libApp.so is now in /firebase-app-unity-3.0.0/libs/x86/libApp.so in oreginal version it was in folder /firebase-app-unity-3.0.0/libs/armeabi-v7a/libApp.so
aftter building with this settings

the .apk\lib\ folder is structured like this:

and after installing apk on my andorid device (nexus 7) the problem is not solved :(




regarding to your questions:

Could you try out this project to see whether it works for you?
- no it does not work for me yet :)


  If not, sort of things we need to look at to figure out what's going on with your environment:
  • Unity version (exact version, pro etc.)
  •  - Unity 5.5.2f1(64bit) Pro
  • Operating system
    - Windows 10 Home / testing device runs on android 4.4.4
  • Other plugins in your project (if any)
  • - no other plugins
  • Build configs that work vs those that fail
  • - quickstart app works correctly with device filter set to FAT(ARMv7+x86) (but this si no go to me, becuse of apk file size is too big)
    - your test app is not packed correctly with those settings (firebase libraries are only in libs/x86 folder
  • Sample project - if you can share one.
  • - testing process see above




Thank you Stewart for helping us!


--jl





Dňa streda, 8. marca 2017 4:18:13 UTC+1 Stewart Miles napísal(-a):
Hmm, this makes me wonder whether you have an old version of the Play Services Resolver in your project.  Could you try deleting the Assets/PlayServicesResolver directory and re-importing the feature plugin you're using (they all include this common component).

We added support for unpacking AARs when shared libraries that support multiple ABIs are present and including just the shared libraries for the target ABI.

I've attached our Firebase Analytics project which contains a couple of apks that were built for x86 and armv7, both include the shared libraries for just the target ABI and run as expected.
Could you try out this project to see whether it works for you?  If not, sort of things we need to look at to figure out what's going on with your environment:
  • Unity version (exact version, pro etc.)
  • Operating system
  • Other plugins in your project (if any)
  • Build configs that work vs those that fail
  • Sample project - if you can share one.
Cheers,
Stewart


Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3
Auto Generated Inline Image 4
Auto Generated Inline Image 5
Auto Generated Inline Image 6
Auto Generated Inline Image 7
Auto Generated Inline Image 8

Stewart Miles

unread,
Mar 8, 2017, 12:23:31 PM3/8/17
to fireba...@googlegroups.com
It definitely sounds like you have background resolution disabled.  You're correct, the project I zipped up targeted only the x86 ABI, that's why you see unpacked AARs with just the x86 libs in there.  The fact that you switched the target ABI to armv7 and the AARs were not recreated and unpacked such that only the armv7 libraries are present suggests that you have background resolution disabled in the Android Resolver.

Change the Android Resolver settings here:

Make sure "Enable Background Resolution" is checked:

When changing target ABI settings (e.g FAT vs. armv7 vs. x86) the AARs should be unpacked / modified in the Plugins/Android/ directory to satisfy the target configuration.

Cheers,
Stewart 



To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Ian Lipták

unread,
Mar 8, 2017, 3:40:59 PM3/8/17
to Firebase Google Group
I have exactly the sam resolver settings. And aars are unpacked as you can see here:
when FAT selected libraries are .aar and it contains x86 and armabi-v7a folders with .so files

when  ARMv7 is selected it is upacked to folders and there is only libs/armabi-v7a libs .so

I think it has wrong folder structure or some configuration is missing because unity is not able to include it when building with gradle

with Internal (default) build system it is packed correctly with any device filter. 

--jl


Dňa streda, 8. marca 2017 18:23:31 UTC+1 Stewart Miles napísal(-a):
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3

Stewart Miles

unread,
Mar 10, 2017, 11:25:56 AM3/10/17
to fireba...@googlegroups.com
Ah I missed that key bit of information, you're building using "Gradle (New)" rather than the Internal build system.

Ok, we've reproduced it.  It looks like - while running through the plethora of build config combinations supported by Unity - this is one we missed.  We're working on a fix right now which looks like it will involve unpacking the AAR, performing variable expansion (as Unity doesn't set the applicationId among other things), stripping unused ABI shared libs (as Unity isn't setting the target ABI) and finally repacking the AAR before including it into the project.

For the moment, as a workaround you can use one of the following:
Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Stewart Miles

unread,
Mar 15, 2017, 12:46:39 PM3/15/17
to Firebase Google Group
We just released 3.0.1 which should resolve this issue.

You'll need to delete all files and directories labeled with "Gspr" under Plugins/Assets/Android to force dependency resolution.

Cheers,
Stewart

Ian Lipták

unread,
Mar 16, 2017, 11:05:12 AM3/16/17
to Firebase Google Group
Thank you Stewart for update! Keep going.

--jl

Dňa streda, 15. marca 2017 17:46:39 UTC+1 Stewart Miles napísal(-a):

David Sepulveda

unread,
Sep 14, 2017, 9:33:53 PM9/14/17
to Firebase Google Group
Hi everyone, I had the same problem, and I just find the solution.
Firebase 4.1.0 - Android Resolution fails with spaces in filesystem paths.

https://github.com/firebase/quickstart-unity/issues/110

It worked for me, I hope this can help anyone else.
Reply all
Reply to author
Forward
0 new messages