[英]Google Glass: GDK with Android Studio
我正在尝试将新的Google Glass开发套件与Android Studio配合使用。 不幸的是,我没有取得多大成功。
我收到错误:“Gradle:package com.google.android.glass.touchpad不存在”
我已经将清单中的uses-library添加如下:
<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的依赖项部分。
dependencies {
compile files('libs/gdk.jar')
}
任何帮助都将非常感激。
更改compileSdkVersion
在你build.gradle
文件中直接引用GDK附加:
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
buildToolsVersion "19.0.2"
// other stuff...
}
(如果安装了更高版本的SDK, buildToolsVersion
可能比19.0.2更新,只要它至少为19.0.2。)
今天是2015年1月10日,从现在开始,最好的选择是:
更改build.gradle文件中的compileSdkVersion以直接引用GDK加载项:
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
buildToolsVersion "19.1.0"
// other stuff...
}
您应该首先安装19.1.0构建工具。
您是否尝试右键单击libs文件夹中的jar并点击“add as library”?
编辑:我发现除了在模块设置和build.gradle中添加它之外,你还必须这样做。 使用gradle进行清洁/重建也可以使其正常工作。
在KitKat之后,将compileSdkVersion
更改为“Google Inc.:Glass Development Kit Preview:19”为我工作。 注意:我还必须在内置SDK Manager中安装GDK Preview后重新启动Android Studio。 在我重新启动之前,Android Studio无法识别GDK预览。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.