使用providerInstaller java.lang.ClassNotFoundException时:没有';在路径:DexPathList上找不到类

使用providerInstaller java.lang.ClassNotFoundException时:没有';在路径:DexPathList上找不到类,java,android,eclipse,Java,Android,Eclipse,出现以下异常:- package com.example.providerinstallertest; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.Toast; import com.google.android.gms.common.GooglePlayServicesUtil;

出现以下异常:-

package com.example.providerinstallertest;

import android.app.Activity;


   import android.content.Intent;
    import android.os.Bundle;
    import android.widget.Toast;

    import com.google.android.gms.common.GooglePlayServicesUtil;
    import com.google.android.gms.security.ProviderInstaller;
    import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener;

    public class MainActivity extends Activity implements ProviderInstallListener {
        /**
         * Updating provider asynchronously.
         */
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            // Update the provider asynchronously
            ProviderInstaller.installIfNeededAsync(this, this);
        }
        /**
         * The provider is already installed and up-to-date.
         */
        @Override
        public void onProviderInstalled() {
            Toast.makeText(this, "Provider Installed.Google play Services are up-to-date", Toast.LENGTH_SHORT).show();
        }
        /**
         * Provider Installation failed. Check errorCode whether it is recoverable
         * or not.
         */
        @Override
        public void onProviderInstallFailed(int errorCode, Intent intent) {
            if (GooglePlayServicesUtil.isUserRecoverableError(errorCode)) {
                // Retry to install update in case of recoverable error.
                ProviderInstaller.installIfNeededAsync(this, this);
            } else {
                // Please update your Google Play Services.
                Toast.makeText(this, "Please update your Google Play Services.", Toast.LENGTH_SHORT).show();
            }
        }
    }
Manifiest文件在此:

java.lang.ClassNotFoundException: Didn't find class "com.example.providerinstallertest.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.providerinstallertest-2.apk"],nativeLibraryDirectories= [/data/app-lib/com.example.providerinstallertest-2, /vendor/lib, /system/lib]]


我已经尝试过了,但没有任何效果,所以我想为此运行provider安装程序。我添加了googlePlayServices作为lib,但它仍然不起作用,并引发了我上面提到的异常。其次,当我删除ProviderInstallListener时,项目开始工作,但我想使用ProviderInstallListener运行项目
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.providerinstallertest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.providerinstallertest.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>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    </application>

</manifest>