1

perhaps it's a newbie question because I'm still new to java/android..sorry.. I'm getting this following errorLog for onclick(SettingActivity). I found some similar posts talk about jar file which I already imported from urban airship library. hope someone can help me get through this kindly. Thank you much!

Unable to resolve superclass of Lcom/app/android/SettingActivity; (2487)
Link of class 'Lcom/app/android/SettingActivity;' failed
Could not find class 'com.app.android.SettingActivity', 
  referenced from method com.app.android.HomeActivity.onOptionsItemSelected
VFY: unable to resolve const-class 594 (Lcom/app/android/SettingActivity;) 
  in Lcom/app/android/HomeActivity;

HomeActivity.java

// Initiating Menu XML

@Override
public boolean onCreateOptionsMenu(Menu bottom_menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.bottom_menu, bottom_menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.btn_logout:
        userFunctions.logoutUser(getApplicationContext());
        Intent login = new Intent(getApplicationContext(), LoginActivity.class);
        login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(login);
        finish();
        return true;
    case R.id.btn_setting:
        Intent i = new Intent(getApplicationContext(), SettingActivity.class);
        startActivity(i);
        finish();
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

SettingActivity.java

package com.app.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.urbanairship.Logger;
import com.urbanairship.analytics.InstrumentedActivity;
import com.urbanairship.location.UALocationManager;

public class SettingActivity extends InstrumentedActivity {

    Button launchButton, locationButton;
    IntentFilter boundServiceFilter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.setting);

update

Now i get these error after clean up..

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.app.android.SettingActivity
   at com.app.android.HomeActivity.onOptionsItemSelected(HomeActivity.java:169)
   at android.app.Activity.onMenuItemSelected(Activity.java:2507)
   at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:982)
   at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
   at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
   at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
   at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:468)
   at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:126)
   at android.view.View$PerformClick.run(View.java:14165)
   at android.os.Handler.handleCallback(Handler.java:605)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:137)
   at android.app.ActivityThread.main(ActivityThread.java:4517)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
   at dalvik.system.NativeStart.main(Native Method)

enter image description here

JJD
  • 50,076
  • 60
  • 203
  • 339
etrademom
  • 221
  • 4
  • 12
  • see [this](http://stackoverflow.com/a/10046725/1289716) answer that may help you. – MAC Oct 18 '12 at 05:08

1 Answers1

2

Try, creating a folder libs in your project directory (parallel to drawables, assets etc.) and put all your external jars there..

Then right click on your project -> configure build path-> add external jars (add them from libs folder),

and clean your project.. should work fine..

Lazy Ninja
  • 22,342
  • 9
  • 83
  • 103
ngesh
  • 13,398
  • 4
  • 44
  • 60
  • Thanks for the answer! In fact, I do already have the libs folder with bunch jar files. And I added the external jars and cleaned the project. still no luck.. – etrademom Oct 18 '12 at 05:30
  • @etrademom .. also delete the android dependencies folder in build path... sometimes it does't get refreshed.. – ngesh Oct 18 '12 at 05:35
  • well..I deleted the android dependencies folder and it gives me errors on google map classes..how to get it back please? – etrademom Oct 18 '12 at 05:40
  • @etrademom.. go to source and say **order import export** for all libraries you need except the android defualt libs.. and clean project.. should fix it.. – ngesh Oct 18 '12 at 05:45