Trying to integrate both UTNotifications plugin and Facebook plugin in Unity throw me this error when adding Facebook plugin and building my project for Android:
Warning: [Temp/StagingArea/AndroidManifest-main.xml:45, /path_to_my_projetct/code/Temp/StagingArea/android-libraries/facebook-android-sdk-4.6.0/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion=‘21’ Warning: [Temp/StagingArea/AndroidManifest-main.xml:45, /path_to_my_projetct/code/Temp/StagingArea/android-libraries/facebook-android-wrapper-release/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion=‘23’
So, facebook generates two manifest, each one with a different target sdk version by its own. I’ve checked the manifest targetSdkVersion in Assets/Plugins/Android at it has targetsdkversion=20, and in every Android Plugin it’s the same value (also minSdkVersion is set to 15 in every manifest of the project).
I can’t edit the StagingArea manifests because these are regenerated each time I build the app.
Does anybody know how to solve it or has experimented this bug?
Unity merges all manifests together using a merge tool in order to produce 1 single AndroidManifest when building the game.
It takes its own pre-made manifest and merges that with every manifest of the libraries you added to your project.
It looks like you have 2 different Facebook libraries (trying to decipher the names from the error message you posted: facebook-android-wrapper-release and facebook-android-sdk-4.6.0).
In addition to that, you can define the minimal target Android SDK version your game supports (in player settings).
It looks like there’s a discrepancy between all of these values (you have defined minimal target SDK to 20 in the player settings, and one of the libraries uses 21, while the other uses 23).
Unity doesn’t know how to handle that, since it doesn’t know what to set for that value by itself.
Hi, @liortal , I have a similar issue here. Do you think that I should update my Unity to make it compatible with the new Facebook SDK plugin? Currently, i’m using Unity 5.1.2p3 with Facebook-unity-SDK 7.3.0. This is the error that i came across when i’m trying to build my app to android device:
Warning: [Temp/StagingArea/AndroidManifest-main.xml:30, /Users/admin/Desktop/src/company/game/Temp/StagingArea/android-libraries/facebook-android-sdk-4.8.2/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion=‘23’
Warning: [Temp/StagingArea/AndroidManifest-main.xml:30, /Users/admin/Desktop/src/company/game/Temp/StagingArea/android-libraries/facebook-android-wrapper-release/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion=‘23’
What i’ve done this far is that i have updated the latest Android SDK (6.0) API level 23. Tried to play around with existing android manifest but there is still no success.
Any help will be very much appreciated! Thank you!
Your game is configured to be targetting API level 21, but the Facebook SDK is targetting API level 23 (Android 6).
You should set the game to also target API 23, otherwise it will not work together with the latest FB SDK.
Thanks for the quick reply, @liortal ! I assume that i need to set the minimum API level in the player settings to 23? That is not possible since the maximum API level value here is 21 for my Unity version. Does updating my Unity will increase the API level for the player settings? Sorry i’m still a beginner, mate
Edit: Well, updating my Unity version to 5.3.2p1 does not help at all. Error still occurs. However, the minimum API level in unity player settings does increase to 22. I have updated my android SDK version to the latest and now I wonder why it does not add up until 23 in unity.