我在这里看到其他线程有类似的症状,但没有一个答案解决了我的问题.我正在关注谷歌地图视图教程http://developer.android.com/resources/tutorials/views/hello-mapview.html并严格遵循所有方向,我不断收到此错误.. java.lang.ClassNotFoundException:加载程序中的com.goodintechnology.maps.Mymap dalvik.system.PathClassLoader [/data/app/com.goodintechnology.maps-1.apk]
我从头开始很多次,但每次,只要我将Activity更改为MapActivity,就会抛出错误.应用目标是Google API 2.2,模拟器是相同的,启用了GPS.我已尝试在Applications语句之前,之后和之中放置uses-library语句,但这并未改变任何内容.我甚至尝试将语句垂直放在清单中.所以,经过大约8个小时搞乱这个,我把它交给你们所有人.这是代码:
AndroidManifest.xml
Run Code Online (Sandbox Code Playgroud)
<uses-library android:name="com.google.android.maps" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Mymap"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
和布局main.xml
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="My key that was generated on google is here. trust me"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
和Mymap类
package com.goodintechnology.maps;
import com.google.android.maps.MapActivity;
import android.os.Bundle;
public class Mymap extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle …Run Code Online (Sandbox Code Playgroud) 我到处寻找,看起来这很常见,很简单.我有一个来自数据库的字符串,"Ros%E9"将最简单的方法转换为带有重音e的"Rose"是什么?