合并Android清单

时间:2015-11-29 10:52:36

标签: android parse-platform merge android-manifest

我正在尝试合并两个简单的android清单,但我有一个调试错误,例如:

AndroidJavaException:java.lang.NoSuchMethodError:没有静态方法,名称=' setApplicationPaused'签名='(Z)V'在类Lcom / parse / ParsePushUnityHelper;

我猜其中一个插件有错误的引用

我合并了这个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>

这个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>

对此:

<?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>

有人可以告诉我出了什么问题吗?

由于

1 个答案:

答案 0 :(得分:0)

您已将清单包更改为com.unity3d.player。我相信哪个是Unity库。现在您的应用程序从那里开始,但Parse依赖项仅在您的应用程序模块中可用(其包ID为life.belt.gb3d)。

因此,请尝试将您的包更改回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>