android.content.ActivityNotFoundException:找不到处理Intent的Activity

前端之家收集整理的这篇文章主要介绍了android.content.ActivityNotFoundException:找不到处理Intent的Activity前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是 Android的新手.我正在尝试使用谷歌位置API,当在模拟器中运行它显示不幸的是你的应用程序停止工作.
我做了一个adb logcat,这是我的stacktrace
10-31 23:43:02.010  2370  2370 D AndroidRuntime: >>>>>> START     com.android.internal.os.RuntimeInit uid 0 <<<<<<
10-31 23:43:02.011  2370  2370 D AndroidRuntime: CheckJNI is ON
10-31 23:43:02.026  2370  2370 I art     : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:02.030  2370  2370 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-31 23:43:02.044  2370  2370 E memtrack: Couldn't load memtrack module (No such file or directory)
10-31 23:43:02.044  2370  2370 E android.os.Debug: Failed to load memtrack module: -2
10-31 23:43:02.045  2370  2370 I Radio-JNI: register_android_hardware_Radio DONE
10-31 23:43:02.062  2370  2370 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
10-31 23:43:02.073  2228  2240 I art     : CollectorTransition marksweep + semispace GC freed 125(-7KB) AllocSpace objects,0(0B) LOS objects,57% free,379KB/891KB,paused 5.591ms total 5.591ms
10-31 23:43:02.080  2228  2242 D DefContainer: Copying /data/local/tmp/HighwayMechanic.apk to base.apk
10-31 23:43:02.181  1138  1177 I PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl931695514.tmp/base.apk pkg=com.highway.highwaymechanic isa=x86 vmSafeMode=false debuggable=true oatDir = /data/app/vmdl931695514.tmp/oat
10-31 23:43:02.190  2382  2382 W dex2oat : Unexpected cpu variant for X86 using defaults: x86
10-31 23:43:02.190  2382  2382 W dex2oat : Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-avx2) for the command line:
10-31 23:43:02.190  2382  2382 W dex2oat : /system/bin/dex2oat --zip-fd=6 --zip-location=base.apk --oat-fd=7 --oat-location=/data/app/vmdl931695514.tmp/oat/x86/base.odex --instruction-set=x86 --instruction-set-variant=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m --swap-fd=8 --debuggable
10-31 23:43:02.190  2382  2382 I dex2oat : /system/bin/dex2oat --debuggable
10-31 23:43:08.200  2382  2382 I dex2oat : dex2oat took 6.009s (threads: 1) arena alloc=2MB java alloc=6MB native alloc=32MB free=2MB
10-31 23:43:08.276  1138  1162 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=-1: uninstall pkg
10-31 23:43:08.294  1138  1177 I PackageManager: Package com.highway.highwaymechanic codePath changed from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1; Retaining data and using new
10-31 23:43:08.295  1138  1162 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=-1: replace pkg
10-31 23:43:08.296  1138  1177 W PackageManager: Code path for com.highway.highwaymechanic changing from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1
10-31 23:43:08.296  1138  1177 W PackageManager: Resource path for com.highway.highwaymechanic changing from /data/app/com.highway.highwaymechanic-2 to /data/app/com.highway.highwaymechanic-1
10-31 23:43:08.333  1138  1177 W Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure,returning read-only value.
10-31 23:43:08.333  1138  1177 I art     : Starting a blocking GC Explicit
10-31 23:43:08.353  1138  1177 I art     : Explicit concurrent mark sweep GC freed 10787(756KB) AllocSpace objects,11(220KB) LOS objects,19% free,5MB/6MB,paused 517us total 13.651ms
10-31 23:43:08.357  1138  1177 W PackageManager: Couldn't remove dex file for package:  at location /data/app/com.highway.highwaymechanic-2/base.apk,retcode=-1
10-31 23:43:08.359  1138  1177 I ActivityManager: Force stopping com.highway.highwaymechanic appid=10053 user=0: pkg removed
10-31 23:43:08.360  2370  2370 I art     : System.exit called,status: 0
10-31 23:43:08.360  2370  2370 I AndroidRuntime: VM exiting with result code 0.
10-31 23:43:08.400  1138  1138 D JobSchedulerService: Receieved: android.intent.action.PACKAGE_REMOVED
10-31 23:43:08.403  1566  1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REMOVED
10-31 23:43:08.404  1566  1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.404  1138  1255 I InputReader: Reconfiguring input devices.  changes=0x00000010
10-31 23:43:08.414  1925  1925 W ContextImpl: Calling a method in the system process without a qualified user:  android.app.ContextImpl.startService:1221  android.content.ContextWrapper.startService:581 android.content.ContextWrapper.startService:581 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2725 
10-31 23:43:08.418  1138  1641 I BroadcastQueue: Delay finish: com.android.keychain/.KeyChainBroadcastReceiver
10-31 23:43:08.514  1138  1255 I InputReader: Reconfiguring input devices.  changes=0x00000010
10-31 23:43:08.515  1138  2212 I BroadcastQueue: Resuming delayed broadcast
10-31 23:43:08.516  1566  1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
10-31 23:43:08.516  1566  1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.602  1138  1255 I InputReader: Reconfiguring input devices.  changes=0x00000010
10-31 23:43:08.602  1566  1566 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_REPLACED
10-31 23:43:08.602  1566  1566 D CarrierServiceBindHelper: mHandler: 3
10-31 23:43:08.602  1566  1566 D CarrierConfigLoader: mHandler: 9 phoneId: 0
10-31 23:43:08.617  2390  2390 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
10-31 23:43:08.619  2390  2390 D AndroidRuntime: CheckJNI is ON
10-31 23:43:08.635  2390  2390 I art     : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:08.640  2390  2390 D ICU     : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
10-31 23:43:08.654  2390  2390 E memtrack: Couldn't load memtrack module (No such file or directory)
10-31 23:43:08.654  2390  2390 E android.os.Debug: Failed to load memtrack module: -2
10-31 23:43:08.655  2390  2390 I Radio-JNI: register_android_hardware_Radio DONE
10-31 23:43:08.667  2390  2390 D AndroidRuntime: Calling main entry com.android.commands.am.Am
10-31 23:43:08.669  1138  2212 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.highway.highwaymechanic/.MainActivity} from uid 0 on display 0
10-31 23:43:08.691  2390  2390 D AndroidRuntime: Shutting down VM
10-31 23:43:08.695  2390  2395 I art     : Debugger is no longer active
10-31 23:43:08.695  2390  2401 E art     : Thread attaching while runtime is shutting down: Binder_2
10-31 23:43:08.695  2390  2401 I AndroidRuntime: NOTE: attach of thread 'Binder_2' Failed
10-31 23:43:08.697  2402  2402 I art     : Not late-enabling -Xcheck:jni (already on)
10-31 23:43:08.697  2402  2402 I art     : Late-enabling JIT
10-31 23:43:08.702  2402  2402 I art     : JIT created with code_cache_capacity=2MB compile_threshold=1000
10-31 23:43:08.708  1138  1712 I ActivityManager: Start proc 2402:com.highway.highwaymechanic/u0a53 for activity com.highway.highwaymechanic/.MainActivity
10-31 23:43:08.717  2402  2409 E art     : Failed sending reply to debugger: Broken pipe
10-31 23:43:08.717  2402  2409 I art     : Debugger is no longer active
10-31 23:43:08.728  2402  2402 W System  : ClassLoader referenced unknown path: /data/app/com.highway.highwaymechanic-1/lib/x86
10-31 23:43:08.747  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.747  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.748  2402  2402 W GooglePlayServicesUtil: Google Play services is missing. 
10-31 23:43:08.748  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.755  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.764  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.764  2402  2402 W GooglePlayServicesUtil: Google Play services is missing.
10-31 23:43:08.797  2402  2402 D gralloc_goldfish: Emulator without GPU emulation detected.
10-31 23:43:08.818  1138  1170 I ActivityManager: Displayed com.highway.highwaymechanic/.MainActivity: +129ms
10-31 23:43:10.932  1138  1429 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms&pcampaignid=gcore_8115000--- flg=0x80000 pkg=com.android.vending} from uid 10053 on display 0
10-31 23:43:10.933  2402  2402 D AndroidRuntime: Shutting down VM
10-31 23:43:10.933  2402  2402 E AndroidRuntime: FATAL EXCEPTION: main
10-31 23:43:10.933  2402  2402 E AndroidRuntime: Process: com.highway.highwaymechanic,PID: 2402
10-31 23:43:10.933  2402  2402 E AndroidRuntime: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms&pcampaignid=gcore_8115000--- flg=0x80000 pkg=com.android.vending }
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:3917)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:3877)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:748)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4200)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4168)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at com.google.android.gms.dynamic.zza$5.onClick(Unknown Source)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.view.View.performClick(View.java:5198)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.view.View$PerformClick.run(View.java:21147)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:739)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5417)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-31 23:43:10.933  2402  2402 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-31 23:43:10.934  1138  1712 W ActivityManager:   Force finishing activity com.highway.highwaymechanic/.MainActivity
10-31 23:43:10.935   943   943 D gralloc : Registering a buffer in the process that created it. This may cause memory ordering problems.
10-31 23:43:10.935   943   943 E libEGL  : called unimplemented OpenGL ES API
10-31 23:43:10.935   943   943 E SurfaceFlinger: glCheckFramebufferStatusOES error 1711643839
10-31 23:43:10.935   943   943 E SurfaceFlinger: got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
10-31 23:43:11.448  1138  1162 W ActivityManager: Activity pause timeout for ActivityRecord{40e8f1c u0 com.highway.highwaymechanic/.MainActivity t11 f}
10-31 23:43:21.478  1138  1162 W ActivityManager: Activity destroy timeout for ActivityRecord{40e8f1c u0 com.highway.highwaymechanic/.MainActivity t11 f}

这是我的Android_manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.highway.highwaymechanic"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="23" />

    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
     <Meta-data 
         android:name="com.google.android.gms.version" 
         android:value="@integer/google_play_services_version" />
     <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity
        android:name="com.highway.highwaymechanic.Map"
        android:label="@string/title_activity_map" >
     </activity>
   </application>
</manifest>

这是我的MainActivity.java文件

package com.highway.highwaymechanic;


import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends FragmentActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main,menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button,so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
  }
}

这是我的MapsActivity.java文件

package com.highway.highwaymechanic;

     import android.os.Bundle;
     import android.support.v4.app.FragmentActivity;
     import com.google.android.gms.maps.CameraUpdateFactory;
     import com.google.android.gms.maps.GoogleMap;
     import com.google.android.gms.maps.OnMapReadyCallback;
     import com.google.android.gms.maps.SupportMapFragment;
     import com.google.android.gms.maps.model.LatLng;
     import com.google.android.gms.maps.model.MarkerOptions;


     public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
    @Override
     protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap map) {

        LatLng sydney = new LatLng(-34,151);
        map.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
        map.moveCamera(CameraUpdateFactory.newLatLng(sydney));
     }
   }

当在模拟器中运行它崩溃时不幸的是应用程序停止工作.

请帮帮我.
提前致谢

解决方法

我相信这应该是最新版本的Google Play服务客户端库修复的.请注意,这是客户端库中的修复,因此您必须使用SDK管理器将库更新为最新版本并重新编译应用程序.

有关详细信息,请查看此链接

https://code.google.com/p/gmaps-api-issues/issues/detail?id=4862

原文链接:https://www.f2er.com/android/317758.html

猜你在找的Android相关文章