我有一个Android项目,我将其转换为MonkeyTool的AspectJ项目但是当我们将它运行到模拟器或设备时,它返回ClassNotFoundError。我无法弄清楚这个问题,因为同一个项目作为Android项目在每个设备上安全运行。请在下面找到LogCat以便更好地理解:
logcat的:
02-04 02:21:38.108: E/AndroidRuntime(1480): java.lang.RuntimeException: Unable to instantiate application com.handygo.rockasap.RockstandApplication: java.lang.ClassNotFoundException: Didn't find class "com.handygo.rockasap.RockstandApplication" on path: DexPathList[[zip file "/data/app/com.handygo.rockasap-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.handygo.rockasap-1, /system/lib]]
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4317)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.os.Handler.dispatchMessage(Handler.java:102)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.os.Looper.loop(Looper.java:136)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.ActivityThread.main(ActivityThread.java:5017)
02-04 02:21:38.108: E/AndroidRuntime(1480): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 02:21:38.108: E/AndroidRuntime(1480): at java.lang.reflect.Method.invoke(Method.java:515)
02-04 02:21:38.108: E/AndroidRuntime(1480): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
02-04 02:21:38.108: E/AndroidRuntime(1480): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
02-04 02:21:38.108: E/AndroidRuntime(1480): at dalvik.system.NativeStart.main(Native Method)
02-04 02:21:38.108: E/AndroidRuntime(1480): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.handygo.rockasap.RockstandApplication" on path: DexPathList[[zip file "/data/app/com.handygo.rockasap-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.handygo.rockasap-1, /system/lib]]
02-04 02:21:38.108: E/AndroidRuntime(1480): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-04 02:21:38.108: E/AndroidRuntime(1480): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
02-04 02:21:38.108: E/AndroidRuntime(1480): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.Instrumentation.newApplication(Instrumentation.java:975)
02-04 02:21:38.108: E/AndroidRuntime(1480): at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
我的清单文件是:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comp.name"
android:installLocation="auto"
android:versionCode="57"
android:versionName="4.1.9" >
<!-- android:maxSdkVersion="17" max version create problem in Reader -->
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<permission
android:name="com.handygo.rockasap.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.handygo.rockasap.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-feature
android:name="android.permission.ACCESS_FINE_LOCATION"
android:required="false" />
<uses-feature
android:name="android.permission.ACCESS_COARSE_LOCATION"
android:required="false" />
<uses-feature
android:name="android.permission.SEND_SMS"
android:required="false" />
<uses-feature
android:name="android.hardware.location"
android:required="false" />
<uses-feature
android:name="android.hardware.location.network"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<!-- Version check the WIFI and Location permission -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:name=".RockstandApplication"
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<service android:name="com.handygo.rockasap.utils.GCMIntentService" />
<receiver
android:name=".utils.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.handygo.rockasap" />
</intent-filter>
</receiver>
<receiver android:name=".utils.NetworkCheckReceiver" >
<intent-filter android:priority="999" >
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
<!-- <service android:name="com.google.analytics.tracking.android.CampaignTrackingService" />
<receiver
android:name="com.handygo.rockasap.services.ReferralReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES" >
<intent-filter android:priority="999" >
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver> -->
<receiver
android:name=".utils.BookReaderEventsReciever"
android:exported="false" >
<intent-filter>
<action android:name="com.handygo.rockasap.utils.BookReaderEvents" />
</intent-filter>
</receiver>
<receiver android:name=".utils.BootCompleteReciever" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".screens.RBReader"
android:configChanges="orientation|keyboardHidden|screenSize"
android:icon="@drawable/app_icon"
android:label="Rockstand"
android:launchMode="singleTask"
android:theme="@style/FBReader.Activity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".error.BugReportActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="FBReader crash"
android:process=":crash"
android:theme="@style/FBReader.Activity" />
<activity
android:name=".screens.NewspapersActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
>
</activity>
<activity
android:name="org.geometerplus.android.fbreader.crash.FixBooksDirectoryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="@style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="CachedCharStorageException" />
</intent-filter>
</activity>
<activity
android:name="org.geometerplus.android.fbreader.crash.MissingNativeLibraryActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":crash"
android:theme="@style/FBReader.Dialog" >
<intent-filter>
<action android:name="android.fbreader.action.CRASH" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="ExceptionInInitializerError" />
</intent-filter>
</activity>
<service
android:name="org.geometerplus.android.fbreader.api.ApiService"
android:exported="false"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.fbreader.action.API" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<activity
android:name="org.geometerplus.android.fbreader.network.AuthenticationActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.BuyBooksActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.AddCatalogMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.AddCustomCatalogActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" >
</activity>
<activity
android:name="org.geometerplus.android.fbreader.network.AuthorizationMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.TopupMenuActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Dialog" />
<activity
android:name="org.geometerplus.android.fbreader.network.NetworkBookInfoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:process=":networkLibrary"
android:theme="@style/FBReader.Activity" >
</activity>
<receiver
android:name="org.geometerplus.android.fbreader.network.ListenerCallback"
android:process=":networkLibrary" >
<intent-filter>
<action android:name="android.fbreader.action.network.SIGNIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity
android:name=".screens.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".screens.UpdatingScreen"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<activity
android:name=".menu.RASAPActivity"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<activity
android:name=".screens.HomeActivity"
android:hardwareAccelerated="false"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name=".screens.BookShelfActivity"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".browser.CustomWebBrowserActivity"
android:imeOptions="actionSend|flagNoEnterAction"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" />
<activity
android:name=".screens.WebPayUActivity"
android:imeOptions="actionSend|flagNoEnterAction"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="adjustNothing" />
<activity
android:name=".bookshelf.IneractiveBook"
android:screenOrientation="sensorPortrait" >
</activity>
<activity
android:name=".screens.NotificationActivity"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".bookshelf.MyVideo_Palyer"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.Panel" >
</activity>
<activity
android:name="com.artifex.mupdfdemo.MuPDFActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" >
</activity>
<activity
android:name="com.artifex.mupdfdemo.OutlineActivity"
android:label="@string/outline_title"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" >
</activity>
<!-- NATIVE LOGIN -->
<!-- The authenticator service -->
<service
android:name=".services.AuthenticationService"
android:exported="false" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<activity
android:name=".screens.AuthenticatorActivity"
android:excludeFromRecents="true"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name=".screens.RegistrationActivity"
android:excludeFromRecents="true"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<activity
android:name=".screens.ForgotPasswordActivity"
android:configChanges="orientation"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<activity
android:name=".screens.BookMagazineListActivity"
android:configChanges="orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".screens.PurchaseHistoryActivity"
android:configChanges="orientation"
android:launchMode="singleTask" >
</activity>
<activity
android:name=".download.DownloadMngrListActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".screens.BookDetailActivityNew"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name=".screens.FBReaderCLass"
android:configChanges="orientation|keyboardHidden|screenSize"
android:icon="@drawable/app_icon"
android:label="Rockstand"
android:launchMode="singleTask"
android:theme="@style/FBReader.Activity" >
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".screens.FinishActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name=".screens.ShareOnWebActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="cx.hell.android.pdfview.OpenFileActivity"
android:configChanges="orientation|keyboardHidden"
android:process=":networkLibrary" />
<activity
android:name=".screens.TakeATour"
android:screenOrientation="sensorPortrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".screens.OperatorPackageListActivity"
android:configChanges="orientation"
android:theme="@android:style/Theme.Light.NoTitleBar" >
</activity>
<activity
android:name=".screens.BookDetailsMoreReviews"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".utils.GcmAlert"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".screens.SmsActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<service android:name=".services.RockstandService" />
<activity
android:name=".screens.SubscriptionActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" >
</activity>
<activity
android:name=".screens.ChangePassworddActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name="com.artifex.mupdfdemo.ScreenShotsActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".screens.RockstandUserProfileActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="adjustNothing" >
</activity>
<activity
android:name=".screens.MoreActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name=".screens.SearchActivityNew"
android:label="@string/title_activity_search_activity_new"
android:screenOrientation="portrait" >
</activity>
<!-- Provider Added by mithilesh -->
<provider
android:name=".DataProvider"
android:authorities="com.handygo.rockasap.DataProvider"
android:exported="true"
android:multiprocess="true" >
</provider>
<!-- Provider Added by mithilesh -->
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- Used for Google Play Store Campaign Measurement-->
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<receiver
android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
</application>
</manifest>
请提出任何解决方案。
答案 0 :(得分:-2)
"com.handygo.rockasap.RockstandApplication"
,这个类存在于项目中,但没有Android Manifest的条目,所以请输入Entry并尝试...喜欢
<activity
android:name="com.handygo.rockasap.RockstandApplication"
android:label="@string/title_activity_search_activity_new"
android:screenOrientation="portrait" >
</activity>