“MapFragment cannot be resolved to a type” even though I am on API level 17

烂漫一生 提交于 2019-12-05 08:11:16

To use MapFragment, you need the Android library project attached to your app (as you had) and the import statement for com.google.android.gms.maps.MapFragment. Based on your comments, the latter part was the issue.

Usually, Eclipse suggest to import it by itself, so I never thought of doing it manually.

I have run into that problem on occasion as well, where -- steadfastly refuses to add an import. I have not been able to come up with a reproducible scenario, and it happens infrequently enough that I just shrug, add it manually, and move along to other things. I'm also uncertain whether the problem is with Eclipse or with any ADT extensions to the import resolver.

Besides, I went without Eclipse for a long time in Android development, typing in import statements manually, and so I'm kinda used to it.

Btw, you answer a lot of questions here on SO, do you have time for anything else? ;-)

I am a fast typist, courtesy of several years as a teenager typing on a manual typewriter.

(For you young'uns reading this, a "typewriter" was basically a keyboard directly connected to a printer, and a "manual typewriter" was one that use the mechanical action of pressing the keys to actually put the letters on the paper, and therefore worked without electricity. Also, you are cordially invited to get off my lawn.)

Manually add the import, import com.google.android.gms.maps.MapFragment; I have been facing the same issue, And tried to resolved it for 3 days and the solution is that easy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!