2

I'm trying to convert facebook android sdk .aar file to Java Library Project (and use it in Unreal Engine 4 as OnlineSubsystem).

What i've done (according to this answer - AAR in Eclipse ANT project):

  1. Download facebook-android-sdk-4.10.1, unzip it, rename facebook-android-sdk-4.10.1.aar to facebook-android-sdk-4.10.1.zip.
  2. Unzip facebook-android-sdk-4.10.1.zip.
  3. Create in Eclipse new android java library project.
  4. Add classes.jar (from facebook-android-sdk-4.10.1.aar) to libs of Eclipse project.
  5. Replace res folder of eclipse project with res folder of .aar file.
  6. Create new android application and add facebook library project to android application project.
  7. Copy all from facebook .aar's AndroidManifest.xml to android application project.

When I'm trying to build application I always get these errors:

  1. res\layout\com_facebook_device_auth_dialog_fragment.xml:22: error: No resource identifier found for attribute 'cardBackgroundColor' in package 'com.facebook'
  2. res\layout\com_facebook_device_auth_dialog_fragment.xml:22: error: No resource identifier found for attribute 'cardElevation' in package 'com.facebook'

The CardView declaration (with errors) look like this:

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="@android:color/transparent"
card_view:cardElevation="10dp">

When I delete these two attributes everything works fine, but I want to know how to build my project without deleting anything.

Unreal Engine uses ant build system for building android application so, please, do not offer me to use gradle.

Thanks.

Community
  • 1
  • 1

1 Answers1

5

I realized that I should add cardview java library project from android sdk (android-sdk\extras\android\support\v7\cardview) to my facebook java library project.

Thanks everyone.

  • Hey @Denis this is great thanks for posting this I'm running into this exact issue. Also trying to integrate Facebook Android SDK into UE4. Got the exact same error. Having trouble getting the cardview library building with my project though. Can you describe where you placed cardview in the UE folder structure to get it to build correctly? – Rob Segal May 24 '16 at 19:17
  • Hi @Rob, I'm sorry, I did not get any notification about your question. I added cardview library to UE_4\Engine\Build\Android\Java\JavaLibs. – Denis Zmitrichenko Mar 14 '17 at 13:54
  • 1
    Hey @Denis not to worry. I did actually find a workaround though I can't remember what this anymore. This also has been less of an issue since 4.13 where .aar support became part of UBT in UE4. – Rob Segal Mar 15 '17 at 18:16
  • Hi @Rob, I did not know about .aar support by UBT since 4.13. Thank you for the information. – Denis Zmitrichenko Mar 17 '17 at 14:01