Android Studio - Appcompat build fail values-v23/styles_bases.xml

后端 未结 13 2569
囚心锁ツ
囚心锁ツ 2020-12-15 03:57

I\'ll start from what I want to achieve: building the googlecast-manager example provided here: https://github.com/googlecast/GameManagerSamples I followed instructions here

相关标签:
13条回答
  • 2020-12-15 04:17

    If you are working in Eclipse do the following:

    1. In your AndroidManifest.xml file change android:targetSdkVersion to 23
    2. Open Project settings (ALT + Enter while focused in Project Explorer)
    3. Go to Android tab and in Project Build Target section mark Android 6.0
    4. Clean and build your project

    NOTE: when you do this have in mind that Android OS would treat your app as if it was designed to work on Android M. So for example if you use some dangerous permissions you should add routines to check then on runtime.

    0 讨论(0)
  • 2020-12-15 04:20

    The answer #31 & #11 in this discussion can solve this issue: https://code.google.com/p/android/issues/detail?id=183122

    0 讨论(0)
  • 2020-12-15 04:21

    I also encountered the same problem and now have fixed it. What you just have to do is

    1. Inside your Android Studio
      1. press Shift button two times, a search box will appear type build.gradle
      2. choose build.gradle module:app from the suggestion.
      3. major version of compileSdkVersion and support libraries under dependencies should be same as following code depict.
    2. Inside Eclipse
      find build.gradle module:app and do the same.

    Note: download and install properly the latest API which is now API 23.

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.0"
    
        defaultConfig {
            applicationId "com.example.inzi.app"
            minSdkVersion 9
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:23.0.0'
    }
    
    0 讨论(0)
  • 2020-12-15 04:21

    I resolved like below

    android {
        compileSdkVersion "Google Inc.:Google APIs:21"
        buildToolsVersion "23.0.0"
    
        defaultConfig {
            minSdkVersion 9
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
    }
    

    replaced the above dependencies with below...

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.google.android.gms:play-services:7.8.0'
    }
    
    0 讨论(0)
  • 2020-12-15 04:21

    The problem generally occurs due to version issues. The following dependencies and compilesdkversion Worked for me:-

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
       }
     }
    
    dependencies {
    
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.support:wearable:+'
    compile 'com.google.android.gms:play-services-wearable:+'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:support-v13:23.0.+'
    compile 'com.firebase:firebase-client-android:2.2.4+'
    }
    
    0 讨论(0)
  • 2020-12-15 04:22

    To correct this error in android studio procceded like this : i went to sdk manager and i downloaded and updated all packages of android api 23 file => project structure and i changed compile sdk version from 21 to 23 and build tools version from 21 to 23

    0 讨论(0)
提交回复
热议问题