Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by gutentagdesign1 · May 03, 2014 at 06:25 AM · manifestmerge

how can i merge two android manifest.xml files?

I use two plugins in my project. Both of them have androidmainfest.xml at the same path. Problem accurs. How can I merge them into one? I copy the content here, wish someone can help me. Thanks a lot!!!!!

 <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
 <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
 <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="@string/app_id" />
 
 <activity android:name="cn.sharesdk.unity3d.demo.MainActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustPan|stateHidden">
   <intent-filter>
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
  </activity>

  <activity android:name="cn.sharesdk.framework.ShareSDKUIShell" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:windowSoftInputMode="stateHidden|adjustResize">
   <intent-filter>
     <data android:scheme="tencent100371282" />
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.BROWSABLE" />
     <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
 </activity>
 
 
 <activity android:name="com.android.AndroidNativeBridge" android:label="@string/app_name" 
     android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" 
     android:launchMode="singleTask" android:screenOrientation="portrait"  tools:merge="override">
   
   <intent-filter>
     ***<!--action android:name="android.intent.action.MAIN" /-->***/////////////if I open the sentence here there will be two icons appear after installing our project apk file. But if I leave it like this, the sharing to other platforms function does not work!!!!
     <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
   
   <intent-filter>
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.DEFAULT" />
     <category android:name="android.intent.category.BROWSABLE" />
     <data android:scheme="oauth" android:host="androidnative" />
   </intent-filter>
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
 </activity>
 
 <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
 </activity>
 <activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
 </activity>
 <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
 </activity>
 <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 855824361110459" />
   
 
 
 <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
 </activity>
 
 <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
   <meta-data android:name="android.app.lib_name" android:value="unity" />
   <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
 </activity>
   
 <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
 <receiver android:name="com.unionassets.android.plugin.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
   <intent-filter>
     <action android:name="com.google.android.c2dm.intent.RECEIVE" />
     <category android:name="com.example.gcm" />
   </intent-filter>
 </receiver>
 <service android:name="com.unionassets.android.plugin.GcmIntentService" />
 <activity android:name="com.facebook.LoginActivity" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation">
 </activity>
 <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 395891937214418" />
 <activity android:name="com.facebook.unity.FBUnityLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
 </activity>
 <activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
 </activity>
   
  

 <receiver android:exported="true" android:name="com.android.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
   <intent-filter>
     <action android:name="com.google.android.c2dm.intent.RECEIVE" />
     <category android:name="REPLACE_WITH_BUNDLE_IDENTIFIER" />
   </intent-filter>
 </receiver>

 <service android:name="com.android.gcm.GcmIntentService" />
  
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
1

Answer by RafaelMariano · May 03, 2014 at 07:22 AM

Nice question, dude!

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 Subhajit-Nath · May 03, 2014 at 09:52 AM 0
Share

That's not an answer.

avatar image
0

Answer by Get_A123 · May 03, 2014 at 07:55 AM

Declare your manifest header like this:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools">

And then add one of the following appropriate attributes to the relevant Activity(s):

 tools:merge="override"
 tools:merge="remove"
Comment
Add comment · Show 2 · 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 gutentagdesign1 · May 03, 2014 at 08:17 AM 0
Share

Hi thanks for your answer.But I've tried this method, still not work normally.

avatar image gutentagdesign1 · May 03, 2014 at 08:22 AM 0
Share

In the document of one plugins I found the method, but I still have no idea how can I do as it ordered.

When you build Unity app for android without any plugins, main applicationactivityy class is UnityPlayerActivity. When you using Android Native Plugin it replace UnityPlayerActivity class by AndroidNativeBridge class with is extended from UnityPlayerActivity.

Without plugin: Android App → UnityPlayerActivity With plugin Android App → AndroidNativeBridge → UnityPlayerActivity

With mean is you want to use 2 plugin in you project you have to extend one plugin from another. To have picture like: Android App → AndroidNativeBridge → OtherPlugin → UnityPlayerActivity

or: Android App → OtherPlugin → AndroidNativeBridge → UnityPlayerActivity

To be able to do this you should have at least one plugin with full open source and source eclipse project. Android Native Plugin comes with full open source and eclipse source project.

For example you have another plugin you want to use with Android Native Plugin. Open Android Native Eclipse project. Add Other Plugin jar file to the project Extend AndroidNativeBridge from other plugin Activity class. Rebuild androidnative.jar and replace it in your project

After this step both plugin should work correctly.

avatar image
0

Answer by gutentagdesign1 · May 03, 2014 at 09:14 AM

I've found the method, it says:

To be able to do this you should have at least one plugin with full open source and source eclipse project. Android Native Plugin comes with full open source and eclipse source project.

For example you have another plugin you want to use with Android Native Plugin. Open Android Native Eclipse project. Add Other Plugin jar file to the project Extend AndroidNativeBridge from other plugin Activity class. Rebuild androidnative.jar and replace it in your project

After this step both plugin should work correctly.

And I tried to find the jar file: package cn.sharesdk.unity3d.demo;

import android.os.Bundle; import cn.sharesdk.unity3d.ShareSDKUtils; import com.unity3d.player.UnityPlayerActivity;

public class MainActivity extends UnityPlayerActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ShareSDKUtils.prepare(); } }

The shareSDK plugin only supply this jar file no source code. I found out that I can't modify the file above, what should I do then?

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

23 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

Related Questions

Merging 2 AndroidManifest.xml's 1 Answer

How to Merge prime31's manifest xml and vuforia's manifest xml ? 0 Answers

Merge manifest from CYPaySDK with Unity3D 0 Answers

unable to merge androidmenifest 1 Answer

Issue Manifest Merge 2 Answers


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