Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
9
Question by Eugenio · Sep 13, 2013 at 10:29 AM · androidpluginsmanifest

How to write an AndroidManifest.xml combining different plugins?

Hi guys. I have a project in which I'm using Vuforia and Easy Code Scanner. Both of them have iOS and Android dedicated plugins for this reason both of them have an AndroidManifest.xml.

Actually the plugins and the manifest of Vuforia are into the plugins folder while the Easy Code Scanner Stuff is in the plugin subfolder of the original package folder. When I try to activate the Easy Code Scanner a "class not found exception" is launched.

I moved the content into the plugins folder except for the AndroidManifest.xml file because there is already the one from Vuforia and I will get an "activity not found exception". I presume I have to merge the 2 different AndroidManifest.xml files. I tried to do that but I miserably failed.

Can anyone please give me an hint on how to perform this merge?

Thank you very much !!!

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

3 Replies

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

Answer by luvcraft · Sep 20, 2013 at 01:44 AM

Easy answer:

  1. copy AndroidManifest.xml from C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer to [your game]/Assets/Plugins/Android

  2. edit that file to include everything needed by both of your plugins

  3. Build and enjoy!

Crazy answer that I started typing first before I thought of Easy answer:

  1. grab the Amazon Android SDK, and install the unitypackage.

  2. look at the manifest.xml that it puts in Assets/Plugins/AmazonIAPAndroid , and create your own manifest.xml files following the same format, in their own folders in /Assets/Plugins . (so, you'd have one Assets/Plugins/Vuforia/manifest.xml and one Assets/Plugins/EasyCodeScanner/manifest.xml )

  3. In the Unity Editor, under the "Amazon" drop down menu, run "generate androidmanifest.xml"

  4. That should create an AndroidManifest.xml in Assets/Plugins/Android which combines the stuff you specified in the manifest.xml files (along with the Amazon IAP manifest stuff, which you can subsequently remove if you want to).

  5. Build and enjoy!

Comment
Add comment · Show 4 · 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 Eugenio · Sep 20, 2013 at 10:59 AM 0
Share

I really think I'm merging the features very badly. Could you please be so kind to do this for me so I can understand what I'm doing wrong? Ins$$anonymous$$d of using the scanner I'm uploading an example of prime[31] plugins manifest because now I'm also stucked with those that are much more urgent.

P31$$anonymous$$anifest and QCAR$$anonymous$$anifest are the files that come with the plugins. Android$$anonymous$$anifest is what I have merged. (please note that I changed the ext in txt).

Can you please check them for me?

androidmanifest.txt (6.0 kB)
p31manifest.txt (3.3 kB)
avatar image Eugenio · Sep 20, 2013 at 11:01 AM 0
Share

Sorry... here's the missing QCAR$$anonymous$$anifest.

Thank you very very much :)

qcarmanifest.txt (2.8 kB)
avatar image 3rica · Feb 19, 2016 at 07:06 AM 0
Share

Your first answer (above) was working great for me, until I went to build a keystore-signed version of my project. Now, Unity seems to want me to change Android$$anonymous$$anifest.xml to manifest.xml in order to build: Error building Player: XmlException: 'manifest' is expected ....But, when I change the file name and then build, Unity overwrites parts of my manifest file!

avatar image mustafabdikani · Mar 01, 2017 at 07:51 PM 0
Share

Thank you so much i solved

avatar image
2

Answer by Eugenio · Sep 27, 2013 at 10:30 AM

As suggested by the Android Developers here's the general scheme:

 <?xml version="1.0" encoding="utf-8"?>
 
 <manifest>
 
     <uses-permission />
     <permission />
     <permission-tree />
     <permission-group />
     <instrumentation />
     <uses-sdk />
     <uses-configuration />  
     <uses-feature />  
     <supports-screens />  
     <compatible-screens />  
     <supports-gl-texture />  
 
     <application>
 
         <activity>
             <intent-filter>
                 <action />
                 <category />
                 <data />
             </intent-filter>
             <meta-data />
         </activity>
 
         <activity-alias>
             <intent-filter> . . . </intent-filter>
             <meta-data />
         </activity-alias>
 
         <service>
             <intent-filter> . . . </intent-filter>
             <meta-data/>
         </service>
 
         <receiver>
             <intent-filter> . . . </intent-filter>
             <meta-data />
         </receiver>
 
         <provider>
             <grant-uri-permission />
             <meta-data />
             <path-permission />
         </provider>
 
         <uses-library />
 
     </application>
 
 </manifest>

Well... in my case the same application was defined 2 times but with different configurations. What I did is to give priority to QCAR. I have merged the configurations by adding everything that were missed in the application defined for Vuforia. After that I copied all the activities from both the manifests and past them into the application. You should check that every activity is defined only once: if the same activity is defined in both the manifests, just proceed to merge them as done for the application.

Hope those hints could be useful for someone else :)

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 habibieamrullah · Jan 01 at 05:29 AM

Hey everyone, I can not find AndroidManifest.xml inside that directory (C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer).

I can only find LauncherManifest and UnityManifest xml files only.

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

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

18 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

Related Questions

XML Manifest: Unity and Android 1 Answer

Change an Android app's manifest by putting manifest.xml in Plugins/Android folder? 2 Answers

Multiplugin, InMobi and QCAR 0 Answers

AndroidManifest.xml: meta-data unityplayer.UnityActivity 2 Answers

Problems with Multiple Plugins 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