库(Cognalys)类未找到异常

时间:2015-05-22 16:26:05

标签: java android android-library buildpath android-cognalys

我有一个带有google-play-services库和Cognalys库的项目。

应用程序在运行时崩溃。

我和其他库也多次看到过这个错误,有人可以解释一下这句话:

java.lang.ClassNotFoundException: Didn't find class "com.matesnetwork.cogdemov2.CognalysVerification" 
on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/hu.illion.pickmeup.rider-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

为什么这个库是指向谷歌地图罐?如果可以,请尽快给予帮助。

05-22 18:19:55.650: E/AndroidRuntime(14510): FATAL EXCEPTION: main
05-22 18:19:55.650: E/AndroidRuntime(14510): Process: hu.illion.pickmeup.rider, PID: 14510
05-22 18:19:55.650: E/AndroidRuntime(14510): java.lang.RuntimeException: Unable to instantiate receiver com.matesnetwork.cogdemov2.CognalysVerification: java.lang.ClassNotFoundException: Didn't find class "com.matesnetwork.cogdemov2.CognalysVerification" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/hu.illion.pickmeup.rider-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2560)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.app.ActivityThread.access$1700(ActivityThread.java:144)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.os.Handler.dispatchMessage(Handler.java:102)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.os.Looper.loop(Looper.java:135)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.app.ActivityThread.main(ActivityThread.java:5221)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at java.lang.reflect.Method.invoke(Native Method)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at java.lang.reflect.Method.invoke(Method.java:372)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
05-22 18:19:55.650: E/AndroidRuntime(14510): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.matesnetwork.cogdemov2.CognalysVerification" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/hu.illion.pickmeup.rider-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
05-22 18:19:55.650: E/AndroidRuntime(14510):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
05-22 18:19:55.650: E/AndroidRuntime(14510):    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2555)
05-22 18:19:55.650: E/AndroidRuntime(14510):    ... 9 more
05-22 18:19:55.650: E/AndroidRuntime(14510):    Suppressed: java.lang.ClassNotFoundException: com.matesnetwork.cogdemov2.CognalysVerification
05-22 18:19:55.650: E/AndroidRuntime(14510):        at java.lang.Class.classForName(Native Method)
05-22 18:19:55.650: E/AndroidRuntime(14510):        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
05-22 18:19:55.650: E/AndroidRuntime(14510):        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
05-22 18:19:55.650: E/AndroidRuntime(14510):        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
05-22 18:19:55.650: E/AndroidRuntime(14510):        ... 11 more
05-22 18:19:55.650: E/AndroidRuntime(14510):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

清单:

<?xml version="1.0" encoding="utf-8"?>

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<!--
 The following two permissions are not required to use
 Google Maps Android API v2, but are recommended.

-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

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

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<application
    android:name=".app.PickMeUpRiderApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <receiver android:name="com.matesnetwork.cogdemov2.CognalysVerification" >
        <intent-filter>
            <action android:name="com.matesnetwork.cognalys" />
        </intent-filter>
    </receiver>

    <activity
        android:name="hu.illion.pickmeup.rider.act.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
    <activity
        android:name="com.matesnetwork.Cognalys.VerifyMobile"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
    </activity>

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

    <activity
        android:name="com.facebook.LoginActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="hu.illion.pickmeup.rider.act.reglogin.RegLoginActivity"
        android:screenOrientation="portrait" >
    </activity>

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" />
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyB4gUpV3EcS5_uGCsUhn2fznOUDDw6KJHE" />

    <activity
        android:name=".act.reglogin.GalleryOpenerActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="MapPickMeAct"
        android:screenOrientation="portrait" >
    </activity>

    <service android:name="LocationService" >
    </service>

    <uses-library
        android:name="com.google.android.maps"
        android:required="true" />

    <activity
        android:name=".act.CameraActivity"
        android:screenOrientation="portrait" >
    </activity>
    <!-- sms activity -->
    <activity android:name=".act.SMSActivity" >
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:host="ringcaptcha"
            android:scheme="dotodo_sender_scheme" />
    </activity>

    <!-- ring capthca stuff -->

    <activity
        android:name="MapCourierLocationAct"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".act.reglogin.SMSVerifActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".act.reglogin.RegisterActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".act.reglogin.SplashActivity"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

2 个答案:

答案 0 :(得分:1)

将此广播接收器添加到您的清单并进行检查 这将是你的问题

srcdir

答案 1 :(得分:0)

嘿朋友请将CognalysVerification.java的包名更改为您的主包名。

将CognalysVerification.java复制到主包

然后改变这一行

if(arr.length > 0){}