Facebook SDK: Error retrieving parent for item: No resource found that matches the given name

Hi,

I was trying packaging my app with the facebook sdk plugin i am working and got the following two errors:

The AAR imports at UPL file are:

<AARImports>
<insertValue value=“repository $S(PluginDir)/…/…/ThirdParty/repository”/>
<insertNewline/>
<insert>com.facebook,Facebook,4.17.0</insert>
<insertNewline/>
</AARImports>

The .aar file Facebook-4.17.0.aar and the .pom file Facebook-4.17.0.pom are located at:
…\Documents\Unreal Projects\Test_4_14\Plugins\FacebookSDK\ThirdParty\repository\com\facebook\Facebook\4.17.0

The .pom file is the following:


<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.facebook</groupId>
  <artifactId>Facebook</artifactId>
  <version>4.17.0</version>
  <packaging>aar</packaging>
  
  <dependencies>
     <dependency>
       <groupId>com.android.support</groupId>
       <artifactId>appcompat-v7</artifactId>
       <version>23.2.0</version>
       <scope>compile</scope>
       <type>aar</type>
     </dependency>
   </dependencies>
</project>

I even added


<style name="com_facebook_activity_theme" parent="@style/Theme.AppCompat.NoActionBar">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowNoTitle">true</item>
    </style>
	
    <style name="com_facebook_auth_dialog" parent="@style/Theme.AppCompat.Dialog">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
    </style>

to the style.xml in Engine/Build/Android/Java/res/values but still getting the same error.

At the …\Documents\Unreal Projects\Test_4_14\Intermediate\Android\APK\JavaLibs folder both .aar files for appcompat-v7-23.2.0 and Facebook-4.17.0 are extracted.

The issue is that the resources don’t get merged from AAR files. Adding to style above didn’t help because it is the parent=… that isn’t defined, not the 2 styles. You need to copy Theme.AppCompat.*.

The resources should be copied at res folder inside Intermediate/APK/Android, not just extracted at JavaLibs/Facebook-4.17.0/res?

Do we need to merge value.xml from JavaLibs/Facebook-4.17.0/res JavaLibs/appcompat-v7-24.1.1/res, and other similar xml files, like layouts etc and add them at Intermediate/APK/Android/res folder to work properly?

How does this work on android studio.Never really used it.

In the UPL file at resource Copies additions we can add new files with the following syntax.


<resourceCopies>
    <!-- Copy the generated resource file to be packaged--> 
    <copyFile src="$S(PluginDir)/../../lib/Android/res/file_paths.xml" dst="$S(BuildDir)/res/xml/file_paths.xml" />
   
</resourceCopies>

Can we copy a plugin folder, including subfolders and/or files.

I tried with


<copyDir src="$S(PluginDir)/../../lib/Android/res" dst="$S(BuildDir)/res" />

but it’s not working.

Hi, Makis, I’m having the exact same error. Can you help me? What did you do to move forward from this error? Thanks.