Fearghal
Fearghal

Reputation: 11407

Project Clean errors

I have imported a project that i suspect was built in eclipse on a Linux machine to my Android Studio on a Windows Machine.

Many issues were flagged regarding file types, minsdkversion etc etc which i tried solving but this latest is perhaps caused by my attempts, not sure.

I have >100 errors in my vXX\values.xml file where XX is 11, 14 and 21, examples;

C:\Users\xxxx\Desktop\AutoSync\autoSync\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\values-v11\values.xml
Error:(47, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\xxxx\Desktop\AutoSync\autoSync\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\values-v14\values.xml
Error:(17, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
C:\Users\xxxxx\Desktop\AutoSync\autoSync\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\values-v21\values.xml
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.

when i open the offending files i see errors such as: 'cannot resolve symbol "android:actionModeShareDrawable"' in code below:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Base.Theme.AppCompat" parent="Base.V11.Theme.AppCompat">
        <item name="android:actionModeShareDrawable">?actionModeShareDrawable</item>
    </style>

I see comments in the file saying:

   <!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-dev/frameworks/support/v7/appcompat/res/values-v11/themes_base.xml -->

Now I suspect from research i either need to download more APIs (i have 19, 20 and 21 only i think) or i need to adjust my build.Gradle somehow but im not sure on the solution. my build.Gradle says the following

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.xxxx.cvas.autosync"
        minSdkVersion 19
        targetSdkVersion 19
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile project(':gPITCommonautosync')
    compile project(':restApiAutoSync')
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/acra-4.5.0.jar')
    compile files('libs/android-saripaar-1.0.3 .jar')
    compile files('libs/zbar.jar')
}

Any ideas what could be going on here?

Upvotes: 1

Views: 65

Answers (1)

Aniket Thakur
Aniket Thakur

Reputation: 68935

C:\Users\xxxx\Desktop\AutoSync\autoSync\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.0.0\res\values-v11\values.xml

Looks like you are using latest version of AppCompat library. From v21 itself it needs API level 21 (Android 5.0) for successful compilation. So your guess is right change compileSdkVersion to 21 in your gradle file.

Upvotes: 1

Related Questions