Android Studio 无法在设备 : stuck on "Waiting for process: <project>" 上运行应用程序

标签 android debugging android-4.4-kitkat

尝试在我的 Samsung Galaxy S4 上调试我的应用程序时,我得到以下输出:

Waiting for device.
Target device: samsung-samsung_sgh_i337-8c8aa2c7
Uploading file
    local path: C:\Users\awebberley\AndroidStudioProjects\Contacts\app\build\apk\app-debug-unaligned.apk
    remote path: /data/local/tmp/org.intracode.contacts
Installing org.intracode.contacts
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/org.intracode.contacts"
pkg:/data/local/tmp/org.intracode.contacts
Success


Waiting for process: org.intracode.contacts

它只是停留在“waiting for process”消息上,没有运行应用程序。我是 Android 开发的新手,我是否缺少某些东西?

仅供引用,我之前能够在模拟器中启动该应用程序,但在我尝试此操作并返回模拟器后,出现了相同的“等待进程”消息。

这是我的 manifest.xml 文件:

<?xml version="1.0" encoding="utf-8"?>

<application
    android:debuggable="true"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="org.intracode.contacts.MainActivity"
        android:launchMode="standard"
        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>

这是我唯一的 java 文件:

package org.intracode.contacts;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TabHost;
import android.widget.Toast;


public class MainActivity extends ActionBarActivity {

    EditText nameTxt, phoneTxt, emailTxt, addressTxt;

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

        nameTxt = (EditText) findViewById(R.id.txtName);
        phoneTxt = (EditText) findViewById(R.id.txtPhone);
        emailTxt = (EditText) findViewById(R.id.txtEmail);
        addressTxt = (EditText) findViewById(R.id.txtAddress);
        TabHost tabHost = (TabHost) findViewById(R.id.tabHost);

        tabHost.setup();

        TabHost.TabSpec tabSpec = tabHost.newTabSpec("Creator");
        tabSpec.setContent(R.id.creator);
        tabSpec.setIndicator("Creator");
        tabHost.addTab(tabSpec);

        tabSpec = tabHost.newTabSpec("List");
        tabSpec.setContent(R.id.tabContactList);
        tabSpec.setIndicator("List");
        tabHost.addTab(tabSpec);

        final Button addBtn = (Button) findViewById(R.id.btnCreate);
        addBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getApplicationContext(), "Your Contact has been created!", Toast.LENGTH_SHORT).show();
            }
        });

        nameTxt.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {

            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                addBtn.setEnabled(!nameTxt.getText().toString().trim().isEmpty());

            }

                @Override
                public void afterTextChanged(Editable editable) {

            }
        });
    }


    @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);
    }

}

谢谢

最佳答案

"file"-->“使缓存无效/重新启动”对我来说就像一个魅力。

关于Android Studio 无法在设备 : stuck on "Waiting for process: <project>" 上运行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24043149/

相关文章:

android - 以编程方式在 AOSP 构建上启用禁用系统 UI

android - 关于 Android WebView SSL 信任的支持

android - Cocos2D-Python 到 Android/iOS

javascript - 在调试控制台代码上设置断点

validation - 调试 CloudFormation 验证问题

android - MonkeyTalk (2.0.4) Android (KitKat) - ActionBar 溢出菜单支持吗?

android - 电容器 - Ionic - Android 前台推送通知 - PushNotificationActionPerformed 从未调用

android - 在 SeekBar 中无法选择最大值

c++ - CrtDebug 计算器溢出?

java - Android应用无法在Api 19上打开