Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activity not found with AndroidAnnotations

Hi i've added the AndroidAnnotations and configured it; it generates the activity with the underscore _ as suffix, but when I try to lunch the app, it gives this error

   05-26 04:17:23.524: E/AndroidRuntime(5096): java.lang.RuntimeException: 
   Unable to instantiate activity
   ComponentInfo{android_app.candgo/android_app.candgo.HelloAndroidActivity_}:  
   java.lang.ClassNotFoundException: Didn't find class
   "android_app.candgo.HelloAndroidActivity_"    
   on path: /data/app/android_app.candgo-1.apk

Any suggestion about why it doesn't work

PD: I've ADT v22 PD: I've the HelloAndroidActivity_ registered at manifest

This is my manifest.xml (sorry for the delay)

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

  <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name="MainActivity_">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>
like image 750
neoshadybeat Avatar asked Oct 21 '22 09:10

neoshadybeat


1 Answers

You need to add the ".apt_generated", or whichever folder AA outputs to, to your source directories listing. In Android Studio, you can find this in Project Settings -> Modules -> module_in_question -> Sources

like image 162
Karim Varela Avatar answered Oct 29 '22 19:10

Karim Varela