为什么Android Studio无法找到资源?

时间:2017-11-07 16:25:40

标签: android android-studio sdk resources

3 个答案:

答案 0 :(得分:2)

删除

tools:context=".MainAcivity"

源路径应该是这样的

android:src="@drawable/test_image"

答案 1 :(得分:2)

  1. chnage tools:context="com.test.ocr.ocrtest.MainAcivity"

  2. android:src="@drawable/test_image"

  3. 删除/

答案 2 :(得分:1)

请使用下一个代码示例来解决问题:

tools:context=".MainAcivity"
should correct as
tools:context="com.example.Acountname.ProjectName.MainActivity"
(find your package name & include before ".MainActivity")

android:src="@/drawable/test_image"
should correct as
android:src="@drawable/test_image"
(remove "/" from "@/drawable")