实施 Android 手势识别工具框架,在生成的构建文件中收到错误

Implement Android Gesture Recognition Tool framework, receiving errors in generated build files

我正在尝试使用这个 framework for a school project. In order to install the framework it asks you to add a zip file to src. In the zip file I found a java class and some AIDL files. I follow the instructions on this SO post。当我尝试清理和重建时。我收到无法解析符号 class 错误。我会 post 错误日志,但目前我的回购有问题。在线说明使您似乎也需要以某种方式使用 APK,但我不知道该怎么做。有谁知道或可以弄清楚这个框架是如何安装的?如果有任何帮助,我将不胜感激。

如果您更喜欢使用 Android Studio 1.5 而不是 Eclipse 并尝试从网站移植项目:

  1. 执行并创建SVN工作副本android-gesture-recognition-tool文件夹) :

    svn checkout http://android-gesture-recognition-tool.googlecode.com/svn/trunk/ android-gesture-recognition-tool
    

备注:

(a) Android Studio 支持使用其 Checkout from Version Control 项目向导签出 SVN 项目...但是,上面的项目没有任何 build.gradle 文件

(b) 您可以使用 Internet 上的 TortoiseSVN 工具来创建 SVN 工作副本

  1. 来自 Android Studio 新项目向导:

    开始新的 Android 项目

    Configure Your New Project:
        type Application Name: Gesture Trainer
        type Company Domain: android.dfki.de
    
    Select the Form Factors...:
        check Phone and Tablet
        select Minimum SDK: API 8
    
    Add an Activity to Mobile:
        choose Blank Activity
    
    Customize the Activity:
        type Activity Name: Gesture Trainer
    
    Let Gradle finishes its job
    
  2. 关闭Android工作室

  3. Android工作室生成的GestureTrainer 项目文件夹:

    Open GestureTrainer/app/src folder:
        delete androidTest folder
        delete test folder
    
    Open GestureTrainer/app/src/main folder:
        delete every folder in it
        copy res folder from the SVN working copy into it
        copy assets folder from the SVN working copy into it
        copy src folder from the SVN working copy into it
        copy AndroidManifest.xml from the SVN working copy into it
        create aidl folder in it
    
  4. 打开Android工作室;来自 Gesture Trainer 项目 Android Studio 环境:

    Clean Project
    
    Rebuild Project
        Ignore the errors for a while
    
    Go to app/src/main/aidl Android project tree
        Right click on aidl and select New > Package
            Type a new package: de.dfki.ccaal.gestures
        Right click on aidl and select New > Package
            Type a new package: de.dfki.ccaal.gestures.classifier
    
  5. 来自生成的 GestureTrainer 项目文件夹:

    Copy into GestureTrainer/app/src/aidl/de/dfki/ccaal/gestures folder:
        IGestureRecognitionListener.aidl from SVN working copy
        IGestureRecognitionService.aidl from SVN working copy
    
    Copy into GestureTrainer/app/src/aidl/de/dfki/ccaal/gestures/classifier folder:
        Distribution.aidl from SVN working copy
    
  6. Gesture Trainer 项目中修改 app/build.gradle 文件 Android Studio环境如下:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "de.dfki.android.gestureTrainer"
            minSdkVersion 8
            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'])
        //testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
    }
    
  7. 重新启动 Android Studio 并让 Gradle 重新同步项目...

你应该得到如下图所示的东西: