Create New Activity Error: RED SQUIGGLYS EVERYWHERE

70 Views Asked by At

So I have been working with Eclipse and Android Application projects for a few months now, and recently, I have had some problems.

So to give the full backgroud, I changed the target SDK and API of a project, and downloaded every SDK package available. Since then, I have had numerous problems with my programs. But now, everytime I created a new Android Application Project, everything that is auto-generated by Eclipse has a red squiglly line under it and an error message stating that the method "must override or implement a supertype method" or that the "method is undefined" or "cannot be resolved to a type".

I have attempted a Clean and have restarted. I changed the SDK level and the API.

![this is a shot of my code.][1]

Here is my code from my Main Activity file.

public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}

}

These are the errors that show up on the bottom of Eclipse in the console.

*Found 2 versions of android-support-v4.jar in the dependency list, but not all the versions are identical (check is based on SHA-1 only at this time). *All versions of the libraries must be the same at this time. *Jar mismatch! Fix your dependencies

I'm not sure what to do, and apologize for providing so much information. Any help would be greatly appreciated!

UPDATE: Now, when I create a new Android Application Project, there is nothing in the src file. I really have no idea what the heck is going on.

2

There are 2 best solutions below

2
On

This happens when you have added the support jars to your main project and also to library projects. They all come bundled together. Make sure any of your library projects don't have the support jars added to them as libs. If they have and u need them to be there then remove those library jars associations from your main project.

0
On

I had the same kind of problem. They way I fixed it was that I used only the latest version of SDK. I had to get rid of all the other SDK packages.