ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# Android 上的 TF Lite 演示 要在 Android 上构建 TF Lite 演示,请按照下列步骤操作: 1. 安装 Android Studio。我们通过以下链接的说明在 Ubuntu 16.04 上安装了 Android Studio: [https://developer.android.com/studio/install.html](https://developer.android.com/studio/install.html) 2. 查看 TensorFlow 仓库,并应用上一篇技巧中提到的补丁。我们假设您检查了主目录中`tensorflow` 文件夹中的代码。 1. 使用 Android Studio,从路径 `~/tensorflow/tensorflow/contrib/lite/java/demo`打开 Android 项目。如果它抱怨缺少 SDK 或 Gradle 组件,请安装这些组件并同步 Gradle。 2. 构建项目并使用 API​​ > 21 在虚拟设备上运行它。 我们收到了以下警告,但构建成功了。 如果构建失败,您可能希望解决警告: `Warning:The Jack toolchain is deprecated and will not run. To enable support for Java 8 language features built into the plugin, remove 'jackOptions { ... }' from your build.gradle file, and add` `android.compileOptions.sourceCompatibility 1.8` `android.compileOptions.targetCompatibility 1.8` `Future versions of the plugin will not support usage of 'jackOptions' in build.gradle.` `To learn more, go to https://d.android.com/r/tools/java-8-support-message.html` `Warning:The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.` `Android SDK Build Tools 26.0.2 will be used.` `To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.` 您还可以使用 Bazel 从源代码构建整个演示应用,其中包含以下链接中的说明: [https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/lite) 。