我正在尝试将我的 Android 项目 carEgiri 移植到 NokiaX。我得到了这个例外
05-02 04:57:19.989: E/Trace(1928): error opening trace file: No such file or directory (2)
05-02 04:57:19.989: E/AndroidRuntime(1928): FATAL EXCEPTION: main
05-02 04:57:19.989: E/AndroidRuntime(1928): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mcruiseon.pune.nokiax.caregiri/com.mcruiseon.caregiri.Registration}: java.lang.RuntimeException: stub
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1991)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread.access$600(ActivityThread.java:133)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.os.Handler.dispatchMessage(Handler.java:99)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.os.Looper.loop(Looper.java:137)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread.main(ActivityThread.java:4807)
05-02 04:57:19.989: E/AndroidRuntime(1928): at java.lang.reflect.Method.invokeNative(Native Method)
05-02 04:57:19.989: E/AndroidRuntime(1928): at java.lang.reflect.Method.invoke(Method.java:511)
05-02 04:57:19.989: E/AndroidRuntime(1928): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
05-02 04:57:19.989: E/AndroidRuntime(1928): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:559)
05-02 04:57:19.989: E/AndroidRuntime(1928): at dalvik.system.NativeStart.main(Native Method)
05-02 04:57:19.989: E/AndroidRuntime(1928): Caused by: java.lang.RuntimeException: stub
05-02 04:57:19.989: E/AndroidRuntime(1928): at com.google.android.maps.MapActivity.<init>(Unknown Source)
05-02 04:57:19.989: E/AndroidRuntime(1928): at com.mcruiseon.caregiri.Registration.<init>(Registration.java:48)
05-02 04:57:19.989: E/AndroidRuntime(1928): at java.lang.Class.newInstanceImpl(Native Method)
05-02 04:57:19.989: E/AndroidRuntime(1928): at java.lang.Class.newInstance(Class.java:1319)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
05-02 04:57:19.989: E/AndroidRuntime(1928): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1982)
05-02 04:57:19.989: E/AndroidRuntime(1928): ... 11 more
05-02 04:57:22.790: E/SWIPE(1078): clear()
清单文件有(相关部分)
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<!--
<uses-library
android:name="com.google.android.maps"
android:required="true" />
-->
<uses-library
android:name="com.here.android"
android:required="false" />
<meta-data
android:name="com.here.android.maps.appid"
android:value="code" />
<meta-data
android:name="com.here.android.maps.apptoken"
android:value="code" />
<activity
android:name="com.mcruiseon.caregiri.Registration"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="isCarEgiri"
android:value="true" />
</activity>
我的代码使用 MapActivity,
- 我是否需要重写一些代码以不使用 MapActivity(来自 com.google.android.maps),而是使用这里的 api 的?
- 我的模拟器目前使用 4.1.2 Nokia X 作为目标。
如果我取消注释,应用程序将无法安装
-->
这意味着,诺基亚模拟器不支持 com.google.android.maps,API。