0

I'm using the Motorola EMDK 3.1 to programm a little scan application in Android Studio. This application should run at a TC55 on Android 4.1.

I get this error when I try to run my application:

 C:\Users\herold.IDENTWERK\Desktop\EmdkTest\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.1\res\values-v17\values-v17.xml
    Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'.
    Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
    Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
    Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'.
    Error:(17, 21) No resource found that matches the given name: attr 'android:layout_marginEnd'.
    Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
    Error:(23, 21) No resource found that matches the given name: attr 'android:layout_marginStart'.
    Error:(26, 21) No resource found that matches the given name: attr 'android:layout_alignParentStart'.
    Error:(6, 21) No resource found that matches the given name: attr 'android:textAlignment'.
    Error:(10, 21) No resource found that matches the given name: attr 'android:paddingEnd'.
    Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'.
    Error:(26, 21) No resource found that matches the given name: attr 'android:layout_alignParentStart'.
    Error:(37, 21) No resource found that matches the given name: attr 'android:layout_toStartOf'.
    Error:(40, 21) No resource found that matches the given name: attr 'android:layout_alignParentEnd'.
    Error:(44, 21) No resource found that matches the given name: attr 'android:layout_toEndOf'.
    Error:(37, 21) No resource found that matches the given name: attr 'android:layout_toStartOf'.
    Error:(23, 21) No resource found that matches the given name: attr 'android:layout_marginStart'.
    Error:(13, 21) No resource found that matches the given name: attr 'android:paddingStart'.

And this is my Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Symbol Technologies, Inc.:EMDK 3.1 (API 16):16'
    buildToolsVersion '21.1.1'

    defaultConfig {
        applicationId "com.example.herold.emdktest"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
jradich1234
  • 1,410
  • 5
  • 24
  • 29
juli0n_
  • 81
  • 2
  • 7
  • http://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro – IntelliJ Amiya Oct 09 '15 at 14:13
  • For TC55, you should read [here](https://portal.motorolasolutions.com/Support/US-EN/Resolution?solutionId=92649) – BNK Oct 09 '15 at 22:18

2 Answers2

0

Use this instead of yours .I hope it will work.

compileSdkVersion 21
buildToolsVersion '21.1.2'

And

compile 'com.android.support:appcompat-v7:21.0.3'

Make sure you added Motorola EMDK 3.1 jar .

Now , You should use

 compileSdkVersion 24
 buildToolsVersion "24.0.2"

And

 compile 'com.android.support:appcompat-v7:24.2.0'
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

You're getting the error because the latest AndroidStudio templates generates apps that cannot be compile with an API level 16. Like you're doing here compiling against the EMDK.

You can find the latest version of the jar library in the EMDK download for the Mac (that is available as a zip archive instead that having just the setup package like you've for Windows).

You best option is to manually include the com.symbol.emdk.jar in the libs folder of your project and compile the application using the latest available SDK.

android {
  compileSdkVersion 23
   buildToolsVersion "23.0.1"

Last action is to instruct gradle to not compile the emdk jar in the final apk:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'], exclude: ['com.symbol.emdk.jar'])
  compile 'com.android.support:appcompat-v7:23.0.1'
   provided fileTree(dir: 'libs', include: ['com.symbol.emdk.jar'])
}
pfmaggi
  • 6,116
  • 22
  • 43