0

我一次又一次收到此錯誤 錯誤:執行失敗,任務':quickScroll:processDebugAndroidTestManifest'。 > java.lang.RuntimeException:清單合併失敗:uses-sdk元素不能具有「工具:節點」屬性java.lang.RuntimeException:清單合併失敗:uses-sdk元素不能具有「工具:節點」屬性

我嘗試使用工具:node =「merge」。

這是我的清單文件

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="musicplayer.player.music.audioplayer.musicplayer" 
    android:hardwareAccelerated="true" 
    android:versionCode="49" 
    android:versionName="3.5"> 

     <uses-permission android:name="android.permission.WAKE_LOCK" /> 
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> 
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
     <uses-permission android:name="android.permission.INTERNET" /> 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
     <uses-permission android:name="android.permission.USE_CREDENTIALS" /> 
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

     <uses-sdk 
      tools:node="replace" 
      android:minSdkVersion="15" 
      android:targetSdkVersion="23" /> 

     <application 
      android:name="musicplayer.player.music.audioplayer.musicplayer.Utils.Common" 
      android:allowBackup="true" 
      android:icon="@drawable/ic_launcher" 
      android:label="@string/app_name" 
      android:largeHeap="true" > 
      <meta-data 
       android:name="com.google.android.gms.version" 
       android:value="@integer/google_play_services_version" /> 
      <meta-data 
       android:name="com.facebook.sdk.ApplicationId" 
       android:value="@string/fb_app_id" /> 

      <!-- Used for Google Play Store Campaign Measurement --> 
      ; 
      <service android:name="com.google.analytics.tracking.android.CampaignTrackingService" /> 

      <receiver 
       android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver" 
       android:exported="true" > 
       <intent-filter> 
        <action android:name="com.android.vending.INSTALL_REFERRER" /> 
       </intent-filter> 
      </receiver> 

      <!-- Now Playing Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.NowPlayingActivity.NowPlayingActivity" 
       android:exported="true" 
       android:label="@string/now_playing" 
       android:launchMode="singleTask" > 
       <intent-filter> 
        <action android:name="android.intent.action.VIEW" /> 

        <category android:name="android.intent.category.DEFAULT" /> 

        <data android:scheme="content" /> 
        <data android:host="media" /> 
        <data android:mimeType="audio/*" /> 
        <data android:mimeType="application/ogg" /> 
        <data android:mimeType="application/x-ogg" /> 
        <data android:mimeType="application/itunes" /> 
       </intent-filter> 
      </activity> 

      <!-- Equalizer Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.EqualizerActivity.EqualizerActivity" 
       android:exported="true" 
       android:label="@string/equalizer" > 
      </activity> 

      <!-- Launcher Activity --> 

      <activity android:name="musicplayer.player.music.audioplayer.musicplayer.LauncherActivity.LauncherActivity" > 
       <intent-filter> 
        <action android:name="android.intent.action.MAIN" /> 
        <action android:name="android.intent.action.MUSIC_PLAYER" /> 
        <category android:name="android.intent.category.DEFAULT" /> 
        <category android:name="android.intent.category.LAUNCHER" /> 
        <category android:name="android.intent.category.APP_MUSIC" /> 
       </intent-filter> 
      </activity> 

      <!-- Welcome Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.WelcomeActivity.WelcomeActivity" 
       android:label="@string/app_name" > 
      </activity> 

      <!-- Main Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.MainActivity.MainActivity" 
       android:label="@string/app_name" 
       android:theme="@style/AppTheme" > 
      </activity> 

      <!-- Services --> 

      <service android:name="musicplayer.player.music.audioplayer.musicplayer.Services.AudioPlaybackService" /> 
      <service android:name="musicplayer.player.music.audioplayer.musicplayer.Services.AutoFetchAlbumArtService" /> 
      <service android:name="musicplayer.player.music.audioplayer.musicplayer.Services.PinGMusicSongsService" /> 

      <service 
       android:name="musicplayer.player.music.audioplayer.musicplayer.Services.BuildMusicLibraryService" 
       android:exported="false" /> 
      <service 
       android:name="musicplayer.player.music.audioplayer.musicplayer.Services.DashClockExtensionService" 
       android:icon="@drawable/dashclock_icon" 
       android:label="@string/app_full_name" 
       android:permission="com.google.android.apps.dashclock.permission.READ_EXTENSION_DATA" > 
       <intent-filter> 
        <action android:name="com.google.android.apps.dashclock.Extension" /> 
       </intent-filter> 

       <meta-data 
        android:name="protocolVersion" 
        android:value="2" /> 
       <meta-data 
        android:name="worldReadable" 
        android:value="true" /> 
       <meta-data 
        android:name="description" 
        android:value="@string/dashclock_description" /> 
      </service> 

      <!-- Large Widget --> 

      <receiver 
       android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.LargeWidgetProvider" 
       android:label="ACE Large Widget" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> 
       </intent-filter> 

       <meta-data 
        android:name="android.appwidget.provider" 
        android:resource="@xml/large_widget_info" /> 
      </receiver> 

      <!-- Blurred Widget --> 

      <receiver 
       android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.BlurredWidgetProvider" 
       android:label="ACE Blurred Album Art Widget" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> 
       </intent-filter> 

       <meta-data 
        android:name="android.appwidget.provider" 
        android:resource="@xml/blurred_widget_info" /> 
      </receiver> 

      <!-- Album Art Widget --> 

      <receiver 
       android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.AlbumArtWidgetProvider" 
       android:label="ACE Album Art Widget" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> 
       </intent-filter> 

       <meta-data 
        android:name="android.appwidget.provider" 
        android:resource="@xml/album_art_widget_info" /> 
      </receiver> 

      <!-- Listens for media playback buttons (headphone buttons, bluetooth buttons, etc.) --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.HeadsetButtonsReceiver" > 
       <intent-filter> 
        <action android:name="android.intent.action.MEDIA_BUTTON" /> 
       </intent-filter> 
      </receiver> 

      <!-- Small Widget --> 

      <receiver 
       android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.SmallWidgetProvider" 
       android:label="ACE Small Widget" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> 
       </intent-filter> 

       <meta-data 
        android:name="android.appwidget.provider" 
        android:resource="@xml/small_widget_info" /> 
      </receiver> 

      <!-- Large widget configuration activity --> 

      <activity android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.LargeWidgetConfigActivity" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> 
       </intent-filter> 
      </activity> 

      <!-- Small widget configuration activity --> 

      <activity android:name="musicplayer.player.music.audioplayer.musicplayer.WidgetProviders.SmallWidgetConfigActivity" > 
       <intent-filter> 
        <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" /> 
       </intent-filter> 
      </activity> 

      <!-- Widget/Notification Now Playing Activity Broadcast Receiver --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.LaunchNowPlayingReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.LAUNCH_NOW_PLAYING_ACTION" /> 
       </intent-filter> 
      </receiver> 

      <!-- Widget/Notification Play/Pause Broadcast Receiver --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.PlayPauseBroadcastReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.PLAY_PAUSE_ACTION" /> 
       </intent-filter> 
      </receiver> 

      <!-- Widget/Notification Previous Broadcast Receiver --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.PreviousBroadcastReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.PREVIOUS_ACTION" /> 
       </intent-filter> 
      </receiver> 

      <!-- Widget/Notification Next Broadcast Receiver --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.NextBroadcastReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.NEXT_ACTION" /> 
       </intent-filter> 
      </receiver> 

      <!-- Stop Service Broadcast Receiver --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.StopServiceBroadcastReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.STOP_SERVICE" /> 
       </intent-filter> 
      </receiver> 

      <!-- Receiver that gets called when the user changes songs from the Large Widget --> 

      <receiver android:name="musicplayer.player.music.audioplayer.musicplayer.BroadcastReceivers.ChangeTrackBroadcastReceiver" > 
       <intent-filter> 
        <action android:name="musicplayer.player.music.audioplayer.musicplayer.WIDGET_CHANGE_TRACK" /> 
       </intent-filter> 
      </receiver> 

      <!-- Main Settings Activity --> 

      <activity android:name="musicplayer.player.music.audioplayer.musicplayer.SettingsActivity.SettingsActivity" > 
      </activity> 

      <!-- Dummy activity that launches Fragment dialogs from the Main Settings Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.SettingsActivity.PreferenceDialogLauncherActivity" 
       android:label="@string/app_name" 
       android:theme="@style/AppThemeTransparent" > 
      </activity> 

      <!-- Now Playing Queue Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.NowPlayingQueueActivity.NowPlayingQueueActivity" 
       android:label="@string/now_playing_queue" > 
      </activity> 

      <!-- Blacklist Manager --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.BlacklistManagerActivity.BlacklistManagerActivity" 
       android:label="@string/title_activity_blacklist_manager" > 
      </activity> 

      <!-- Music Libraries Editor Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.MusicLibraryEditorActivity.MusicLibraryEditorActivity" 
       android:label="@string/music_library_editor" > 
      </activity> 

      <!-- Music Libraries Editor Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.PlaylistEditorActivity.PlaylistEditorActivity" 
       android:label="@string/playlists" > 
      </activity> 

      <!-- KitKat Fix Activity --> 

      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.Services.KitKatFixActivity" 
       android:allowTaskReparenting="true" 
       android:alwaysRetainTaskState="false" 
       android:clearTaskOnLaunch="true" 
       android:enabled="true" 
       android:excludeFromRecents="true" 
       android:finishOnTaskLaunch="true" 
       android:noHistory="true" 
       android:stateNotNeeded="true" 
       android:theme="@android:style/Theme.NoDisplay" /> 
      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.BrowserSubListActivity.BrowserSubListActivity" 
       android:label="@string/title_activity_browser_sub" > 
      </activity> 
      <activity 
       android:name="musicplayer.player.music.audioplayer.musicplayer.BrowserSubGridActivity.BrowserSubGridActivity" 
       android:label="@string/title_activity_browsser_sub_grid" > 
      </activity> 
     </application> 

    </manifest> 

和清單的文件quickScroll就像

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.andraskindler.quickscroll" 
    android:versionCode="2" 
    android:versionName="0.8.1" > 

    <uses-sdk 
     android:minSdkVersion="14" 
     android:targetSdkVersion="19" /> 

</manifest> 

請幫我解決這個問題。提前致謝。我正在使用Android Studio 2.0.0。

+0

爲什麼不在'build.gradle'文件中設置'minSdkVersion'和'targetSdkVersion'?這會覆蓋任何庫的清單,甚至覆蓋您自己的應用程序的清單。 – CommonsWare

回答

0

不能使用tools:node="replace",相反,你必須使用tools:overrideLibrary作爲Manifest merging markers docs提到:

<uses-sdk android:minSdkVersion="14" 
      android:targetSdkVersion="23" 
      tools:overrideLibrary="com.example.lib1, com.example.lib2"/> 

當然,除非他們的minSdkVersion比你的minSdkVersion更高(這似乎並不爲這裏的情況),你的應用程序的minSdkVersion將優先。

+0

先生,我添加了工具:overrideLibrary =「com.mikhaellopez.circularimageview,com.mobeta.android.dslv,de.psdev.licensesdialog,com.squareup.picasso,com.andraskindler.quickscroll,com.velocity.view.pager。庫,com.velocityviewpagerindicator「在清單。但是,現在它表明Java類中存在一個問題,直到現在都沒問題。 – user3461054

+0

/Users/anuragsingh/AndroidStudioProjects/MusicPlayer/app/src/main/java/musicplayer/player/music/audioplayer/musicplayer/BroadcastReceivers/HeadsetButtonsReceiver.java錯誤:任務執行失敗':app:compileDebugJavaWithJavac'。 >編譯失敗;詳細信息請參閱編譯器錯誤輸出。 – user3461054

+0

當然,在您修復當前問題後,您可能會遇到更多問題。儘管如此,我還是會爲新問題提出新的問題。 – ianhanniballake