2015-10-09 26 views
0

我正在使用Motorola EMDK 3.1在Android Studio中编程一个小扫描应用程序。此应用程序应该在Android 4.1上的TC55上运行。Motorola EMDK 3.1 error(app build intermediates exploded-aar com.android.support appcompat-v7 22.2.1 res values-v21 values-v21.xml)

我得到这个错误,当我尝试运行我的应用程序:

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'. 

这是我的摇篮:

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' 
+0

http://stackoverflow.com/questions/26431676/appcompat-v721-0-0- no-resource-found-that-matches-the-name-attr-andro –

+0

对于TC55,您应该阅读[这里](https://portal.motorolaso​​lutions.com/Support/US-EN/Resolution?solutionId= 92649) – BNK

回答

0

你得到的错误,因为最新的AndroidStudio模板生成的应用程序不能用一个API级别16来编译和你一样”在这里做对EMDK的编译。

您可以在EMDK download for the Mac(该文件可用作zip压缩文件,而不仅仅是Windows的安装包)中找到最新版本的jar库。

您最好的选择是手动将com.symbol.emdk.jar包含在项目的libs文件夹中,并使用最新的可用SDK编译应用程序。

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

最后的动作是指示gradle这个不编译在最终的apk的EMDK罐子:

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']) 
} 
0

使用此,而不是你的。我希望它会工作。

compileSdkVersion 21 
buildToolsVersion '21.1.2' 

而且

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

确保您添加Motorola EMDK 3.1罐子。

现在,你应该使用

compileSdkVersion 24 
buildToolsVersion "24.0.2" 

而且

compile 'com.android.support:appcompat-v7:24.2.0' 
+0

实际上你的'buildToolsVersion'21.1.1''版本与'compile'c​​om.android.support冲突:appcompat-v7:22.2.1'' –

相关问题