2014-07-13 9 views
28

समस्या है नहीं किया जा सकता ..प्रकट विलय विफल हुआ: का उपयोग करता है-sdk: minSdkVersion 8 छोटे

Error:Execution failed for task ':app:processDebugManifest'. 

Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1

कोड build.gradle AndroidManifest में

apply plugin: 'android' 

android { 
    compileSdkVersion 19 
    buildToolsVersion "20.0.0" 

    defaultConfig { 
     applicationId "com.androidexample.gcm" 
     minSdkVersion 8 
     targetSdkVersion 16 
    } 

    buildTypes { 
     release { 
      runProguard false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile 'com.android.support:support-v4:+' 
    compile 'com.google.android.gms:play-services:+' 
    //compile 'com.android.support:support-v4:20.0.0' 
    //compile 'com.google.android.gms:play-services:5.0.77' 

} 

कोड है में।

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

    <!-- GCM requires Android SDK version 2.2 (API level 8) or above. --> 
    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="16" /> 

    <!-- Main activity. --> 
    <application 
     android:name="com.androidexample.gcm.Controller" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" > 
     <!-- Register Activity --> 
     <activity 
      android:name="com.androidexample.gcm.RegisterActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
      <intent-filter> 
       <action android:name="android.intent.action.VIEW" /> 
       <action android:name="android.intent.action.DELETE" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
       <data android:scheme="com.idrivecare.familypro" /> 
      </intent-filter> 
     </activity> 


     <!-- Main Activity --> 
     <activity 
      android:name="com.androidexample.gcm.MainActivity" 
      android:configChanges="orientation|keyboardHidden" 
      android:label="@string/app_name" > 
     </activity> 

     <receiver 
      android:name="com.google.android.gcm.GCMBroadcastReceiver" 
      android:permission="com.google.android.c2dm.permission.SEND" > 
      <intent-filter> 

       <!-- Receives the actual messages. --> 
       <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
       <!-- Receives the registration id. --> 
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> 

       <category android:name="com.androidexample.gcm" /> 
      </intent-filter> 
     </receiver> 

     <service android:name="com.androidexample.gcm.GCMIntentService" /> 
     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 
    </application> 

    <!-- GCM connects to Internet Services. --> 
    <uses-permission android:name="android.permission.INTERNET" /> 

    <!-- GCM requires a Google account. --> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 

    <!-- Keeps the processor from sleeping when a message is received. --> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 

    <!-- Creates a custom permission so only this app can receive its messages. --> 
    <permission 
     android:name="com.androidexample.gcm.permission.C2D_MESSAGE" 
     android:protectionLevel="signature" /> 

    <uses-permission android:name="com.androidexample.gcm.permission.C2D_MESSAGE" /> 

    <!-- This app has permission to register and receive data message. --> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 

    <!-- Network State Permissions to detect Internet status --> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 

    <!-- Permission to vibrate --> 
    <uses-permission android:name="android.permission.VIBRATE" /> 

</manifest> 

धन्यवाद सर ..

+0

चेक इस http://www.reddit.com/r/androiddev/comments/2 9 7xli/howto_use_the_v21_support_libs_on_older_versions/ – deniz

उत्तर

16

तो आप का उपयोग

'com.android.support:support-v4:+' 

यह 21.x उपयोग कर सकते हैं नवीनतम संस्करण है (लेकिन लक्ष्य के साथ एल से कम संगत)

यह

'com.android.support:support-v4:20.+' 
को बदलें के बाद से लगता होगा

तो यह नवीनतम 20.x संस्करण

+1

धन्यवाद श्रीमान। लेकिन अब त्रुटि: निष्पादन कार्य के लिए विफल रहा ': app: processDebugManifest'। > मैनिफेस्ट विलय विफल: उपयोग-एसडीके: minSdkVersion 8 लाइब्रेरी com.google.android.gms में घोषित संस्करण 9 से छोटा नहीं हो सकता है: play-services: 5.0.77 कृपया मेरी सहायता करें। – user1438799

+1

प्ले सेवाएं 5.0 को एपीआई 9 की आवश्यकता है। आपको नवीनतम संस्करण की आवश्यकता है? यदि नहीं, तो पुराने –

+2

का उपयोग करें श्रीमान धन्यवाद। मैं संकलन का उपयोग करता हूं 'com.google.android.gms: play-services: 4.1.32' यह काम करता है। – user1438799

24

समस्या डाउनलोड करेगा क्योंकि आपका ऐप मिनी एसडीके 8 है और आप गूगल प्लस सेवाओं मिनट एसडीके की आवश्यकता है कि 9.

बदलें लाइन "minSdkVersion 8" से "minSdkVersion 9" का उपयोग करने का चयन किया। तो, इसे सहेजें।

के बाद, स्वच्छ परियोजना और यह पुनर्निर्माण।

+3

जांचें कि वह पंक्ति 'min SdkVersion 8' कहां मिली है? मुझे टाइपिंग/रखने की याद नहीं है। – mmcrae

+4

@mmcrae ऐप/build.gradle – AlamoPS

0

मुझे अपनी libGDX एंड्रॉइड स्टूडियो की android/build.gradle फ़ाइल को बदलना पड़ा, इसलिए जब मैं अमेज़ॅन मोबाइल विज्ञापन लाइब्रेरी को एकीकृत करना चाहता था तो ऐसा लगता था।

android { 
    buildToolsVersion "23.0.3" 
    compileSdkVersion 23 
    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
      jniLibs.srcDirs = ['libs'] 
     } 

     instrumentTest.setRoot('tests') 
    } 
    defaultConfig { 
     applicationId "com.foo.bar" 
     // RBC minSdkVersion 8 
     minSdkVersion 9 
     targetSdkVersion 23 
    } 
} 
... 
8

मेरे मामले में मैं {minSdkVersion 9}

 


    defaultConfig { 
      applicationId "com.example.npeducations.week1_lab" 
      minSdkVersion 9 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
      } 

अब यह काम करता है के लिए build.gradle फाइल के अंदर कोड {minSdkVersion 8} बदल ठीक

+0

धन्यवाद। मैंने आपके द्वारा सुझाए गए परिवर्तन और मेनिफेस्ट फ़ाइल में परिवर्तन किया है, दोनों परिवर्तनों के साथ अब यह काम करता है। – munyul

+0

मुझे लगता है कि इस त्रुटि के लिए यह सबसे आम समस्या है। – Genaut

0

आप बस निम्न आदेश चला सकते हैं ।

cordova build android -- --minSdkVersion=15 

यह आपके लिए काम करेगा।

1
<uses-sdk tools:overrideLibrary="your pkg name of libary with conflict" /> 

और जोड़ने xmlns: उपकरण = "http://schemas.android.com/tools" AndroidManifest.xml में

संबंधित मुद्दे