Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by bawenang · Oct 22, 2015 at 08:16 AM · androidpluginandroid-manifest

targetSdk is considered missing when I already put it in my custom AndroidManifest.xml

Hi,

I'm using Unity 5.1.2. And I've got this error when I tried building my project:

CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. C:\Program Files\Java\jdk1.7.0_09\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[

] stdout[ Warning: [Temp\StagingArea\AndroidManifest-main.xml:2, E:\Work\getsocial-unity-sdk\example\GetSocialSDK Demo\Temp\StagingArea\android-libraries\facebook-android-sdk-4.7.0\AndroidManifest.xml:3] Main manifest has android:targetSdkVersion='15'> but library uses targetSdkVersion='23' Note: main manifest lacks a android:targetSdkVersion> declaration, which defaults to value minSdkVersion or 1. Warning: [Temp\StagingArea\AndroidManifest-main.xml:2, E:\Work\getsocial-unity-sdk\example\GetSocialSDK Demo\Temp\StagingArea\android-libraries\facebook-android-wrapper-release\AndroidManifest.xml:3] Main manifest has android:targetSdkVersion='15'> but library uses targetSdkVersion='23' Note: main manifest lacks a android:targetSdkVersion> declaration, which defaults to value minSdkVersion or 1. ] UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.HostView:OnGUI()

In short, I believe this is what happening: Unity didn't recognize any targetSdk although I have it in my Assets/Plugins/Android/AndroidManifest.xml. And so it uses the minSdk for it (the one I set on the player settings, in this case 15). And because on of the library is using targetSdk of 23, it got conflicted. So, what is wrong with this? Is a custom AndroidManifest.xml not recognized anymore? How do one make a custom AndroidManifest.xml? Is it not making it in the "Assets/Plugins/Android"? How do I solve this without having to change the library's xml file?

Oh yeah, BTW, if you are wondering, the said library is the latest Facebook SDK. In its aar files, there's an AndroidManifest.xml that has minSdk = 15 and targetSdk = 23.

Thanks in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by bawenang · Oct 27, 2015 at 09:43 AM

Okay, I finally solved this. I deleted all instances and files of the plugins and libraries (Facebook being one of them), and then reimported the packages of the plugins back. And what do you know, it worked. Weird.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by traunay · Oct 22, 2015 at 04:03 PM

I haven't tried the latest fb sdk yet but I'm using the one before 23 (21 since i havent updated my android sdk yet) and evertyhing's fine.

Have you tried to export the android project? that way you can see your own androidmanifest.xml and there will be a facebook folder as well with its androidmanifest.xml

btw this what's on my project androidmanifest.xml which seems correct to me

 <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="21" />

and this is actually what's on my fb androidmanifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <!--
  * Copyright 2010-present Facebook.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.facebook.android">
     <application/>
     <uses-sdk android:minSdkVersion="6" />
 </manifest>


I'm not sure why yours have targetSDK 23 though.. my suggestion rollback your android sdk (maybe unity 5.1.2 doesnt recognize it yet? lol) or your fb sdk for that matter.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image bawenang · Oct 23, 2015 at 12:55 AM 0
Share

Well, the latest facebook sdk using android:targetSdkVersion="23" in the Android$$anonymous$$anifest.xml in both of its aar files (facebook-android-sdk-4.7.0.aar & facebook-android-wrapper-release.aar). I tried removing this in the manifests, rezipped the aar and build it. When I tried building it, it took a long time. But that's maybe because of my crappy computer though. LoL. But still, that's not really the best way to do it. It's kind of hackish.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

31 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

dll is not allowed to be included or could not be found" error unity3d for android 8 Answers

Why cant I change the android:windowBackground? 0 Answers

How can I browse files on Android outside of the Unity App folder? 2 Answers

How do I use the Android Library in Unity? 0 Answers

Unity3D Compile Error: Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges