Android MapFragment运行时错误-找不到类';maps.j.k';
我正在使用一个SupportMapFragment,并取得了圆满成功。我一点问题都没有 但是,在我的应用程序运行时,我遇到了一个错误。我在一部姜饼手机上运行,手机上有最新的谷歌游戏。还要注意的是,我正在使用SupportMapFragment和其他支持类来满足蜂窝状结构之前的需求Android MapFragment运行时错误-找不到类';maps.j.k';,android,android-fragments,android-maps-v2,supportmapfragment,mapfragment,Android,Android Fragments,Android Maps V2,Supportmapfragment,Mapfragment,我正在使用一个SupportMapFragment,并取得了圆满成功。我一点问题都没有 但是,在我的应用程序运行时,我遇到了一个错误。我在一部姜饼手机上运行,手机上有最新的谷歌游戏。还要注意的是,我正在使用SupportMapFragment和其他支持类来满足蜂窝状结构之前的需求 Could not find class 'maps.j.k', referenced from method maps.y.ae.a` 当我膨胀我的观点时,错误就发生了 inflater.inflate(R.lay
Could not find class 'maps.j.k', referenced from method maps.y.ae.a`
当我膨胀我的观点时,错误就发生了
inflater.inflate(R.layout.fragment_map, container, false);
我的布局文件(fragment_map.xml):
我拥有清单中所述的所有必需权限
这不会引起任何问题,但我很好奇这意味着什么。我还没有找到任何答案这里有一个关于使用support fragment的google maps api V2的快速入门指南 这可能有助于您排除故障 希望这些有帮助。:-) 取代
class="com.google.android.gms.maps.SupportMapFragment"
如果您正在重写
SupportMapfragment
并创建自己的片段类,为什么要在活动xml中使用android:name=“com.google.android.gms.maps.SupportMapfragment”
请改用com.your.package.your.supportmapfragment。您需要使用
class=“com.google.android.gms.maps.SupportMapFragment”
Proguard可能是问题所在-您可能会过度混淆代码。嗯,但在我的project.properties中,我有#Proguard.config=。。。评论说。这不意味着它是残疾的吗?这应该意味着它是残疾的,有趣的问题。同意。我不知道这是不是我的设备。我会用模拟器进行测试,但是模拟器当然不支持很多东西;包括谷歌地图。你能发布你的活动代码、清单和日志猫的完整堆栈跟踪吗?仅凭这些信息是很难评估的。恐怕运气不好。我还注意到,这只会在第一次加载地图时发生。如果最小化应用程序或更改活动等,则返回地图,不会引发错误。
Thread [<1> main] (Suspended)
<VM does not provide monitor information>
PhoneLayoutInflater(LayoutInflater).inflate(int, ViewGroup, boolean) line: 322
MapsFragment.onCreateView(LayoutInflater, ViewGroup, Bundle) line: 90
MapsFragment(Fragment).performCreateView(LayoutInflater, ViewGroup, Bundle) line: 1460
FragmentManagerImpl.moveToState(Fragment, int, int, int, boolean) line: 911
FragmentManagerImpl.moveToState(int, int, int, boolean) line: 1088
BackStackRecord.run() line: 682
FragmentManagerImpl.execPendingActions() line: 1444
FragmentManagerImpl$1.run() line: 429
FragmentActivity$1(Handler).handleCallback(Message) line: 587
FragmentActivity$1(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 150
ActivityThread.main(String[]) line: 4277
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 839
ZygoteInit.main(String[]) line: 597
NativeStart.main(String[]) line: not available [native method]
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View v = inflater.inflate(R.layout.fragment_maps, container, false);
return v;
}
android:name="com.google.android.gms.maps.SupportMapFragment"
class="com.google.android.gms.maps.SupportMapFragment"