0

Motorola EMDK 3.1 を使用して、Android Studio で小さなスキャン アプリケーションをプログラミングしています。このアプリケーションは、Android 4.1 の TC55 で実行する必要があります。

アプリケーションを実行しようとすると、次のエラーが発生します。

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

そして、これは私の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'
4

2 に答える 2

0

最新の AndroidStudio テンプレートは、API レベル 16 でコンパイルできないアプリを生成するため、エラーが発生しています。ここで EMDK に対してコンパイルしているように。

jar ライブラリの最新バージョンは、Mac 用の EMDK ダウンロードで見つけることができます(これは、Windows 用のセットアップ パッケージだけではなく、zip アーカイブとして入手できます)。

プロジェクトの libs フォルダーにを手動で含め、com.symbol.emdk.jar最新の利用可能な SDK を使用してアプリケーションをコンパイルするのが最善の方法です。

android {
  compileSdkVersion 23
   buildToolsVersion "23.0.1"

最後のアクションは、最終的な apk で emdk jar をコンパイルしないように gradle に指示することです。

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'])
}
于 2015-10-10T16:23:42.770 に答える