Android Studio Wear 应用程序错误-无法打开 PNG

标签 android android-studio android-gradle-plugin wear-os

创建新的 Wear 应用程序后出现以下错误。我也在 sdk 文件夹中找到的示例应用程序中得到了这个。

C:\Users\Tom\AppData\Local\Android\android-studio1\sdk\samples\android-20\wearable\SynchronizedNotifications\Application\build\intermediates\exploded-aar\com.google.android.gms\play-services\5.0.77\res\drawable-mdpi\common_signin_btn_text_disabled_focus_light.9.png ERROR: Unable to open PNG file

enter image description here

最佳答案

与目录和文件名长度有关。我认为它需要少于 256 个字符。

C:\Users\Tom\AppData\Local\Android\android-studio1\sdk\samples\android-20\wearable\SynchronizedNotifications\Application\build\intermediates\exploded-aar\com.google.android.gms\播放服务\5.0.77\res\drawable-mdpi\common_signin_btn_text_disabled_focus_light.9.png

是 265 个字符。

将项目移动到较低的目录解决了这个问题。

我将尝试实现到目录的硬链接(hard link)以缩短名称,这样我就不必更新目录结构。

我还向 Android 开发团队提交了一张票。目前优先级设置为小... https://code.google.com/p/android/issues/detail?id=73873

关于Android Studio Wear 应用程序错误-无法打开 PNG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24875555/

相关文章:

android - 如何在Android中处理不同的JAVA版本?

android - 你如何使用 gradle javafx android builder?

android - list 合并失败 : uses-sdk:minSdkVersion 1 cannot be smaller than version 7

android - 如何设置 ActionMode LayoutParams 以使自定义 View match_parent?

android - 无法解析符号 fragment 容器

android - 如何使用 ListView 改进应用程序的设置选项界面?

java - RecyclerViewAdapter OnBindViewHolder 的 ID 为空

android - 尝试使用 SpeechRecognizer(Android 语音识别)但它没有启动?

android - 如何将 Material 设计库导入 Android Studio?

android - 多个dex文件定义Landroid/support/v13/app