Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:36:42+00:00 2026-06-04T14:36:42+00:00

I am trying to run android project. The project has a red x on

  • 0

I am trying to run android project. The project has a red x on the project folder but none of the sub folder has that red x. No code is highlighted that shows an error. Unfortunately none of my projects are executing. When I run as project it says this error.

enter image description here

It does not show any errors in problems tab either.

How can I fix this problem?

My java build path

enter image description here

Edit

Here is my code

public class AndroidLoginActivity extends Activity implements OnClickListener {
EditText username, password;
Button login;

String user, pass;
HttpClient httpclient;
HttpPost httppost;
ArrayList<NameValuePair> nameValuePair;
HttpResponse response;
HttpEntity entity;

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

private void initialise() {
    // TODO Auto-generated method stub
    username = (EditText)findViewById(R.id.etUsername);
    password = (EditText)findViewById(R.id.etPassword);
    login = (Button)findViewById(R.id.btnLogin);

    login.setOnClickListener(this);
}

public void onClick(View v) {
    httpclient = new DefaultHttpClient();
    httppost = new HttpPost("http://10.0.2.2/android_login/index.php");

    user = username.getText().toString();
    pass = password.getText().toString();

    try {
        nameValuePair = new ArrayList<NameValuePair>();

        nameValuePair.add(new BasicNameValuePair("username", user));
        nameValuePair.add(new BasicNameValuePair("password", pass));
        httppost.setEntity(new  UrlEncodedFormEntity(nameValuePair));
        response = httpclient.execute(httppost);
        if(response.getStatusLine().getStatusCode() == 200) {
            entity = response.getEntity();

            if(entity != null) {
                InputStream instream = entity.getContent();
                JSONObject jsonResponse = new JSONObject(convertStreamToString(instream));
                String retUser = jsonResponse.getString("username"); //mysql table field
                String retPass = jsonResponse.getString("password");

                if(username.equals(retUser) && password.equals(retPass)) {
                    SharedPreferences sp = getSharedPreferences("logindetails",0); 
                    SharedPreferences.Editor spedit = sp.edit();
                    spedit.putString("user", user);
                    spedit.putString("pass", pass);
                    spedit.commit();
                    Toast.makeText(getBaseContext(), "Success", Toast.LENGTH_SHORT).show();
                } else {
                    Toast.makeText(getBaseContext(), "Login Failed", Toast.LENGTH_SHORT).show();
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
        Toast.makeText(getBaseContext(), "Login Failed", Toast.LENGTH_SHORT).show();
    }
}

public static String convertStreamToString(InputStream is) {
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    StringBuilder sb = new StringBuilder();

    String line = null;
    try {
        while((line = reader.readLine()) != null) {
            sb.append(line + "\n");
        }
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        try {
            is.close();
        } catch(IOException e) {
            e.printStackTrace();
        }
    }
    return sb.toString();
}
}

Here is my main.xml

<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<EditText
    android:id="@+id/etUsername"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Username..." >

</EditText>

<EditText
    android:id="@+id/etPassword"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textPassword"
    android:text="Password..." />

<Button
    android:id="@+id/btnLogin"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Login" />

</LinearLayout>

here is my menifest file

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zafar.androidlogin"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".AndroidLoginActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

Error Log

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:36:44+00:00Added an answer on June 4, 2026 at 2:36 pm

    I am answering my own question so that If someone else has same problem so will be easy for them to find its solution.

    Solution

    I deleted the file debug.keystore which exist on this path C:\Users\Administrator\.android

    Then I cleaned up project and it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an Android project using the ndk, but I have run
I am trying to run the demo android maps project(MapsDemo) that comes along with
I am trying to build and run an android project using the phonegap framework.
I'm trying to compile and run the task-android-sample code from Google's API website. I
I am trying to send the files from an Android project so that a
I have a simple android project that I am trying to debug inside of
I am trying to run the android update project command on a project i
I'm trying to run my android application on IntelliJ. I created a project from
I'm trying to run a mp3 file using android media player. I'm using this
I have this problem when trying to run hello world program using android SDK.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.