我正在尝试解决未找到的类的错误。 我从过去2周搜索,但无法解决此错误.. 我尝试了所有stackoverflow问题,但无法帮助我。
06-18 17:42:32.171: E/AndroidRuntime(17161): FATAL EXCEPTION: main
06-18 17:42:32.171: E/AndroidRuntime(17161): java.lang.RuntimeException: Unableto instantiate activity ComponentInfo{com.quickblox.sample.chat/com.quickblox.sample.chat.ui.activities.SplashActivity}: java.lang.ClassNotFoundException: Didn't find class "com.quickblox.sample.chat.ui.activities.SplashActivity" on path: /data/app/com.quickblox.sample.chat-1.apk
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2171)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2295)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread.access$700(ActivityThread.java:150)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.os.Handler.dispatchMessage(Handler.java:99)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.os.Looper.loop(Looper.java:137)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread.main(ActivityThread.java:5279)
06-18 17:42:32.171: E/AndroidRuntime(17161): at java.lang.reflect.Method.invokeNative(Native Method)
06-18 17:42:32.171: E/AndroidRuntime(17161): at java.lang.reflect.Method.invoke(Method.java:511)
06-18 17:42:32.171: E/AndroidRuntime(17161): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
06-18 17:42:32.171: E/AndroidRuntime(17161): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
06-18 17:42:32.171: E/AndroidRuntime(17161): at dalvik.system.NativeStart.main(Native Method)
06-18 17:42:32.171: E/AndroidRuntime(17161): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.quickblox.sample.chat.ui.activities.SplashActivity" on path: /data/app/com.quickblox.sample.chat-1.apk
06-18 17:42:32.171: E/AndroidRuntime(17161): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
06-18 17:42:32.171: E/AndroidRuntime(17161): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-18 17:42:32.171: E/AndroidRuntime(17161): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.Instrumentation.newActivity(Instrumentation.java:1071)
06-18 17:42:32.171: E/AndroidRuntime(17161): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
06-18 17:42:32.171: E/AndroidRuntime(17161): ... 11 more
Menifest File是一个轰鸣声。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quickblox.sample.chat"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".App"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".ui.activities.SplashActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activities.MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activities.ChatActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".ui.activities.LoginActivity"
android:label="Login" />
<activity
android:name=".ui.activities.RegistrationActivity"
android:label="Registration" />
</application>
</manifest>
我在Manifest中添加了Acitivity
答案 0 :(得分:0)
用
替换您的包名称package="com.quickblox.sample.chat.ui.activities"
和
<activity
android:name=".SplashActivity"
.....
.....
多数民众赞成......
答案 1 :(得分:0)
尝试用答案解决问题,但在更改包名后,导入错误导致com.quickblox.sample.chat.R