简体   繁体   English

合并Android清单

[英]Merging of Android Manifests

I am trying to merge two simple android manifests but I have a debug error such as : 我正在尝试合并两个简单的android清单,但是出现调试错误,例如:

AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='setApplicationPaused' signature='(Z)V' in class Lcom/parse/ParsePushUnityHelper; AndroidJavaException:java.lang.NoSuchMethodError:类Lcom / parse / ParsePushUnityHelper中没有名称为'setApplicationPaused'signature ='(Z)V'的静态方法;

I guess one of the plugin has a wrong reference 我猜其中一个插件的引用有误

I have merger this android manifest: 我已经合并了这个android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name="com.prime31.UnityPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="sensorLandscape">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
  </application>
</manifest>

And this android manifest: 而这个android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="life.belt.gb3d"
    android:versionCode="1"
    android:versionName="1.0">

  <uses-sdk android:minSdkVersion="10" />

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  <permission android:protectionLevel="signature" android:name="life.belt.gb3d.permission.C2D_MESSAGE" />
  <uses-permission android:name="life.belt.gb3d.permission.C2D_MESSAGE" />

  <application android:label="ParseUnityPushSample" android:icon="@drawable/app_icon">
    <activity android:name=".UnityPlayerActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>

    <receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
      <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="life.belt.gb3d" />
      </intent-filter>
    </receiver>

    <service android:name="com.parse.ParsePushService" />
  </application>
</manifest>

To this one: 对此:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
    <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.WAKE_LOCK" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  <permission android:protectionLevel="signature" android:name="life.belt.gb3d.permission.C2D_MESSAGE" />
  <uses-permission android:name="life.belt.gb3d.permission.C2D_MESSAGE" />
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
    <activity android:name="com.prime31.UnityPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="sensorLandscape">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>

    <receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
      <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
        <category android:name="life.belt.gb3d" />
      </intent-filter>
    </receiver>

    <service android:name="com.parse.ParsePushService" />

  </application>
</manifest>

Can someone tell me what went wrong? 有人可以告诉我出了什么问题吗?

Thanks 谢谢

You have changed your manifest package to com.unity3d.player . 您已将清单包更改为com.unity3d.player I believe which is the Unity library. 我相信这是Unity库。 Now your application is starting from there but Parse dependency is only available in your app module (whose package id is life.belt.gb3d ). 现在,您的应用程序从此处开始,但是Parse依赖项仅在您的应用程序模块中可用(其包ID为life.belt.gb3d )。

So try to change your package back to life.belt.gb3d and modify your manifest like this, 因此,尝试将软件包改回life.belt.gb3d并像这样修改清单,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    
    xmlns:tools="http://schemas.android.com/tools"
    package="life.belt.gb3d"
    android:versionCode="1"
    android:versionName="1.0">
    ....
    <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:debuggable="true"
        tools:merge="override">
    ....
    </application>
</manifest>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM