title: commonsware-cwac java.lang.NoClassDefFoundError
body: <p>every body ...</p>
  
  <p>same of this link <a href="https://github.com/commonsguy/cwac-wakeful" rel="nofollow">cwac-wakeful</a></p>
  
  <p>I have AppListener class :</p>
  
  <pre><code>public class AppListener implements WakefulIntentService.AlarmListener {
  
  public void scheduleAlarms(AlarmManager amr, PendingIntent pi, Context ctx){
      amr.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+60000, AlarmManager.INTERVAL_FIFTEEN_MINUTES, pi);
  }
  
  public void sendWakefulWork(Context ctx){
      WakefulIntentService.sendWakefulWork(ctx, AlarmServiceWakeful.class);
  }
  
  public long getMaxAge(){
      return (AlarmManager.INTERVAL_FIFTEEN_MINUTES*2);
  }
  
  }
  </code></pre>
  
  <p>Then,I create an XML metadata file where identify the class that implements WakefulIntentService.AlarmListener ,so wakeful.xml:</p>
  
  <pre><code>&lt;WakefulIntentService
  listener="com.example.wakefulintentservicetest.AppListener"
  /&gt;
  </code></pre>
  
  <p>Next, registered my AlarmReceiver as a  in my manifest, set to respond to ACTION_BOOT_COMPLETED broadcasts, and with a com.commonsware.cwac.wakeful  element pointing to the XML resource from the previous step, akin to:</p>
  
  <pre><code>&lt;receiver android:name="com.commonsware.cwac.wakeful.AlarmReceiver" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
          &lt;/intent-filter&gt;
  
          &lt;meta-data
              android:name="com.commonsware.cwac.wakeful"
              android:resource="@xml/wakeful"/&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>too, uncommented below line in project.propertise:</p>
  
  <pre><code>proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
  </code></pre>
  
  <p>and added below code to the proguard-project.txt:</p>
  
  <pre><code>-keep class com.example.wakefulintentservicetest.** {
  </code></pre>
  
  <p>public protected private *;
  }</p>
  
  <p>but when I call below code in mainactivity ,oncreate method :</p>
  
  <pre><code>WakefulIntentService.scheduleAlarms(new AppListener(), this, false);
  </code></pre>
  
  <p>gave me below error :</p>
  
  <pre><code>java.lang.NoClassDefFoundError:com/example/wakefulintentservicetest/AppListener
  </code></pre>
  
  <p>can every one help me?</p>
  
  <p>thanks in advance</p>