我是 Android 开发的新手,在使用注释时遇到了问题。我向 Maven 添加了依赖项:
<!-- Android annotations and AA API dependecies start -->
<dependency>
<groupId>com.googlecode.androidannotations</groupId>
<artifactId>androidannotations</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.androidannotations</groupId>
<artifactId>androidannotations-api</artifactId>
</dependency>
<!-- Android annotations and AA API dependecies end -->
注释处理器配置正确,我有我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gl.discovercity" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SplashScreenActivity_">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
当我尝试启动我的应用程序时,我有下一个堆栈跟踪:
05-03 10:12:08.010: ERROR/AndroidRuntime(1246): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gl.discovercity/com.gl.discovercity.SplashScreenActivity_}: java.lang.ClassNotFoundException: com.gl.discovercity.SplashScreenActivity_ in loader dalvik.system.PathClassLoader[/data/app/com.gl.discovercity-2.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.gl.discovercity.SplashScreenActivity_ in loader dalvik.system.PathClassLoader[/data/app/com.gl.discovercity-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
... 11 more
最后,我有一个活动:
@EActivity(R.layout.main)
public class SplashScreenActivity extends Activity {
}
有人可以帮助我吗?:"(