谷歌眼镜:带有 Android Studio 的 GDK [英] Google Glass: GDK with Android Studio

查看:41
本文介绍了谷歌眼镜:带有 Android Studio 的 GDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Android Studio 中使用新的 Google Glass 开发套件.不幸的是,我没有取得太大的成功.

I’m trying to use the new Google Glass Development kit with Android Studio. Unfortunately I'm not having much success.

我收到错误消息:Gradle:包 com.google.android.glass.touchpad 不存在"

I get the error: "Gradle: package com.google.android.glass.touchpad does not exist"

我已将 uses-library 添加到清单中,如下所示:

I've added uses-library to the manifest as follows:

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme" >

    <uses-library
        android:name="com.google.android.glass"
        android:required="true" />


    <activity
        android:name="com.glass.test.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

然后我将 gdk.jar 添加到 libs 目录中.我已经将以下内容添加到我的 build.gradle 的依赖项部分.

Then I've added the gdk.jar to the libs directory. And I've added the following to the dependency section of my build.gradle.

dependencies {
    compile files('libs/gdk.jar')
}

对此的任何帮助将不胜感激.

Any help with this would be very appreciated.

推荐答案

更改 build.gradle 文件中的 compileSdkVersion 以直接引用 GDK 附加组件:

Change the compileSdkVersion in your build.gradle file to refer directly to the GDK add-on:

android {
    compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
    buildToolsVersion "19.0.2"

    // other stuff...
}

(buildToolsVersion 可以比 19.0.2 更新,如果你安装了更高版本的 SDK,只要至少 19.0.2.)

(The buildToolsVersion can be newer than 19.0.2 if you have a higher version of the SDK installed, as long as it's at least 19.0.2.)

这篇关于谷歌眼镜:带有 Android Studio 的 GDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆