Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android 2.1和1.5中启动地图活动会导致崩溃_Android_Android Appwidget - Fatal编程技术网

在Android 2.1和1.5中启动地图活动会导致崩溃

在Android 2.1和1.5中启动地图活动会导致崩溃,android,android-appwidget,Android,Android Appwidget,在我开发的appwidget中,我遇到了一个问题,当我在Android 2.1和1.5中启动一个映射活动时,它会导致崩溃。我只在1.5和2.1中对此进行了评估,它可能发生在1.6中,但我还没有测试。如果我让应用程序运行一段时间,比如在触摸前30分钟到一小时,问题就会神奇地消失 我非常确信这不是我应用程序中的错误,而是安卓系统的错误。有办法解决这个问题吗 堆栈跟踪: I/ActivityManager( 576): Starting activity: Intent { flags=0x1000

在我开发的appwidget中,我遇到了一个问题,当我在Android 2.1和1.5中启动一个映射活动时,它会导致崩溃。我只在1.5和2.1中对此进行了评估,它可能发生在1.6中,但我还没有测试。如果我让应用程序运行一段时间,比如在触摸前30分钟到一小时,问题就会神奇地消失

我非常确信这不是我应用程序中的错误,而是安卓系统的错误。有办法解决这个问题吗

堆栈跟踪:

I/ActivityManager( 576): Starting activity: Intent { flags=0x10000000 comp={net.example.example/net.example.example.ExampleTabWidget} } D/dalvikvm( 576): GC freed 8147 objects / 444432 bytes in 84ms W/dalvikvm( 822): Unable to resolve superclass of Lnet/example/example/ExampleMaps; (55) W/dalvikvm( 822): Link of class 'Lnet/example/example/ExampleMaps;' failed E/dalvikvm( 822): Could not find class 'net.example.example.ExampleMaps', referenced from method net.example.example.ExampleTabWidget.onCreate W/dalvikvm( 822): VFY: unable to resolve const-class 109 (Lnet/example/example/ExampleMaps;) in Lnet/example/example/ExampleTabWidget; W/dalvikvm( 822): VFY: rejecting opcode 0x1c at 0x011c W/dalvikvm( 822): VFY: rejected Lnet/example/example/ExampleTabWidget;.onCreate (Landroid/os/Bundle;)V W/dalvikvm( 822): Verifier rejected class Lnet/example/example/ExampleTabWidget; W/dalvikvm( 822): Class init failed in newInstance call (Lnet/example/example/ExampleTabWidget;) D/AndroidRuntime( 822): Shutting down VM W/dalvikvm( 822): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 822): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 822): java.lang.VerifyError: net.example.example.ExampleTabWidget E/AndroidRuntime( 822): at java.lang.Class.newInstanceImpl(Native Method) E/AndroidRuntime( 822): at java.lang.Class.newInstance(Class.java:1472) E/AndroidRuntime( 822): at android.app.Instrumentation.newActivity(Instrumentation.java:1097) E/AndroidRuntime( 822): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186) E/AndroidRuntime( 822): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) E/AndroidRuntime( 822): at android.app.ActivityThread.access$1800(ActivityThread.java:112) E/AndroidRuntime( 822): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) E/AndroidRuntime( 822): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 822): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 822): at android.app.ActivityThread.main(ActivityThread.java:3948) E/AndroidRuntime( 822): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 822): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 822): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) E/AndroidRuntime( 822): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) E/AndroidRuntime( 822): at dalvik.system.NativeStart.main(Native Method) I/Process ( 576): Sending signal. PID: 822 SIG: 3 I/dalvikvm( 822): threadid=7: reacting to signal 3 I/dalvikvm( 822): Wrote stack trace to '/data/anr/traces.txt' I/Process ( 822): Sending signal. PID: 822 SIG: 9 I/ActivityManager( 576): Process net.example.example (pid 822) has died. 地图活动:

intent=new Intent().setClass(this, ExampleMaps.class);
intent.putExtra("t1",t1);
intent.putExtra("t2",t2);
intent.putExtra("m1",m1);
intent.putExtra("details",details);
spec=tabHost.newTabSpec("Examples").setIndicator("", res.getDrawable(R.drawable.example_tab_icons_map)).setContent(intent);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
tabHost.addTab(spec);
(..)
tabHost.setCurrentTab(0);
public class ExampleMaps extends MapActivity
{
  private MapController mapController;
  private MapView mapView;
  private LocationManager locationManager;

  @Override
  protected boolean isRouteDisplayed()
  {
    return false;
  }

  @Override
  public void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);

    double t1=0, t2=0;
    String alerttext=ExampleWidgetProvider.NODATA, mag, details=ExampleWidgetProvider.NODATA;
    int m1=1;
    Drawable drawable;

    Bundle extras=getIntent().getExtras();
    if(extras !=null)
    {
(..)
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
在ETR检查和其他一些地方,我还没有找到解决方案

已正确设置以下各项:

project.properties

target=Google Inc.:Google APIs:3
清单,在“应用程序”中:


java.lang.VerifyError
看起来可疑。您可能需要卸载、重新生成、重新安装,并确保根据库正确编译。查找与
VerifyError
相关的信息
java.lang.VerifyError
看起来可疑。您可能需要卸载、重新生成、重新安装,并确保根据库正确编译。查找与
VerifyError

相关的信息,谢谢,我将对此进行研究,但是就在今天,我使用android SDK管理器更新了所有SDK和相关工具,并完成了一个干净的构建。此外,这在我尝试过的所有其他Android版本上都能稳定工作。请参阅更新的问题。还没有接近解决方案。请注意,如果启动后30分钟或一小时内我根本不接触小部件,这个问题就会消失。谢谢,我会研究这个问题,但是就在今天,我使用android SDK管理器更新了所有SDK和相关工具,并且我做了一个干净的构建。此外,这在我尝试过的所有其他Android版本上都能稳定工作。请参阅更新的问题。还没有接近解决方案。请注意,如果启动后30分钟或一小时内我根本不触摸小部件,这个问题就会消失。
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;