找不到符号变量ic_launcher

问题描述 投票:1回答:3

我正在尝试在Android Studio for Android Wear中构建一个空的默认项目。我收到此错误:

Error:(23, 41) error: cannot find symbol variable ic_launcher
Error:Execution failed for task ':wear:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

我是可穿戴应用程序开发的新手。任何指针都会有所帮助。

P.S。:我在代码中没有做过任何改变。

java android android-studio import wear-os
3个回答
1
投票

您的drawable文件夹为空。在其中放置一个名为“ic_launcher”的图标


1
投票

您需要将“ic_launcher”图标从mipmap-hdpi文件夹复制到drawable文件夹。我有同样的问题,它有所帮助!


1
投票

或者,只需通过调用R.mipmap.ic_launcher来引用mipmap资源

© www.soinside.com 2019 - 2024. All rights reserved.