无法在Android Studio中运行任何应用

时间:2015-11-11 14:34:05

标签: android android-studio adb

突然间,在中午,我无法在Android Studio上运行stock Android 4.3的三星Galaxy Nexus上运行应用程序(甚至不是从头开始创建的

ADB

11-11 15:26:12.213 5344-5344/? E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at android.os.Parcel.readException(Parcel.java:1431)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at android.os.Parcel.readException(Parcel.java:1385)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at android.content.pm.IPackageManager$Stub$Proxy.installPackageWithVerificationAndEncryption(IPackageManager.java:3253)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at com.android.commands.pm.Pm.runInstall(Pm.java:931)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at com.android.commands.pm.Pm.run(Pm.java:109)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at com.android.commands.pm.Pm.main(Pm.java:77)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
11-11 15:26:12.213 5344-5344/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)
11-11 15:26:12.221 5344-5344/? E/JavaBinder: Unknown binder error code. 0xfffffff7
11-11 15:26:12.221 5344-5344/? E/ServiceManager: error in getService
11-11 15:26:12.221 5344-5344/? E/ServiceManager: android.os.RemoteException: Unknown binder error code. 0xfffffff7
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.os.BinderProxy.transact(Native Method)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.os.ServiceManager.getService(ServiceManager.java:55)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:1893)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:1891)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.util.Singleton.get(Singleton.java:34)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:73)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
11-11 15:26:12.221 5344-5344/? E/ServiceManager:     at dalvik.system.NativeStart.main(Native Method)
11-11 15:26:12.221 5344-5344/? I/Process: Sending signal. PID: 5344 SIG: 9
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime: Error reporting crash
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime: java.lang.NullPointerException
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime:     at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime:     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
11-11 15:26:12.221 5344-5344/? E/AndroidRuntime:     at dalvik.system.NativeStart.main(Native Method)

同样在运行面板

Uploading file
    local path: /Users/zsszatmari/projects/app-

android/app/build/outputs/apk/app-debug.apk
    remote path: /data/local/tmp/com.app
Installing com.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.app"
    pkg: /data/local/tmp/com.app
Killed 


Launching application: com.app/com.app.ui.LoginActivity.
DEVICE SHELL COMMAND: am start  -n "com.app/com.app.ui.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.app/.ui.LoginActivity }
java.lang.SecurityException: Permission Denial: startActivity asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
    at android.os.Parcel.readException(Parcel.java:1431)
    at android.os.Parcel.readException(Parcel.java:1385)
    at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:1984)
    at com.android.commands.am.Am.runStart(Am.java:617)
    at com.android.commands.am.Am.onRun(Am.java:232)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
    at com.android.commands.am.Am.main(Am.java:75)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
    at dalvik.system.NativeStart.main(Native Method)

`

它适用于模拟器。 我试过擦拭设备(两次),重新启动开发者机器,更换USB电缆。 否则手机运行良好。我可以从Market安装应用程序。 你知道如何让它发挥作用吗?

任何想法?

编辑:

此外,如果我adb install app-debug.apk,它会:

3876 KB/s (1883040 bytes in 0.474s)pkg: /data/local/tmp/app-debug.apk
Killed

为什么会被杀?通过谁?这不是一个非常有用的信息。

还尝试使用另一台桌面操作系统运行Android Studio,效果相同。

3 个答案:

答案 0 :(得分:0)

最终解决方案是根设备,然后使用CyanogenMod升级到4.4。 现在一切正常!

答案 1 :(得分:-2)

尝试添加此

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="refine-categories">
  <h4>Categories</h4>
  <ul class="parent cf">
    <li id='project_category-3' class="popular-category">
      <label class="selectit">
        <input value="3" type="checkbox" name="cat_project_category[]" id="in-project_category-3" />Aanbouw &amp; Opbouw</label>
      <ul class='children'>

        <li id='project_category-33'>
          <label class="selectit">
            <input value="33" type="checkbox" name="cat_project_category[]" id="in-project_category-33" />aanbouw</label>
        </li>

        <li id='project_category-34'>
          <label class="selectit">
            <input value="34" type="checkbox" name="cat_project_category[]" id="in-project_category-34" />algemeen</label>
        </li>

        <li id='project_category-35'>
          <label class="selectit">
            <input value="35" type="checkbox" name="cat_project_category[]" id="in-project_category-35" />Fundering en heiwerken</label>
        </li>

        <li id='project_category-36'>
          <label class="selectit">
            <input value="36" type="checkbox" name="cat_project_category[]" id="in-project_category-36" />garage bouwen</label>
        </li>

        <li id='project_category-37'>
          <label class="selectit">
            <input value="37" type="checkbox" name="cat_project_category[]" id="in-project_category-37" />isoleren</label>
        </li>

        <li id='project_category-38'>
          <label class="selectit">
            <input value="38" type="checkbox" name="cat_project_category[]" id="in-project_category-38" />nieuwbouw</label>
        </li>

        <li id='project_category-39'>
          <label class="selectit">
            <input value="39" type="checkbox" name="cat_project_category[]" id="in-project_category-39" />opbouw</label>
        </li>

        <li id='project_category-40'>
          <label class="selectit">
            <input value="40" type="checkbox" name="cat_project_category[]" id="in-project_category-40" />renovatie</label>
        </li>

        <li id='project_category-41'>
          <label class="selectit">
            <input value="41" type="checkbox" name="cat_project_category[]" id="in-project_category-41" />veranda en serre</label>
        </li>
    </li>
    </ul>
</div>
<div id="refine-categories">
  <h4>Categories 2</h4>
  <ul class="parent cf">
    <li id='project_category-3' class="popular-category">
      <label class="selectit">
        <input value="3" type="checkbox" name="cat_project_category[]" id="in-project_category-3" />Aanbouw &amp; Opbouw</label>
      <ul class='children'>

        <li id='project_category-33'>
          <label class="selectit">
            <input value="33" type="checkbox" name="cat_project_category[]" id="in-project_category-33" />aanbouw</label>
        </li>

        <li id='project_category-34'>
          <label class="selectit">
            <input value="34" type="checkbox" name="cat_project_category[]" id="in-project_category-34" />algemeen</label>
        </li>

        <li id='project_category-35'>
          <label class="selectit">
            <input value="35" type="checkbox" name="cat_project_category[]" id="in-project_category-35" />Fundering en heiwerken</label>
        </li>

        <li id='project_category-36'>
          <label class="selectit">
            <input value="36" type="checkbox" name="cat_project_category[]" id="in-project_category-36" />garage bouwen</label>
        </li>

        <li id='project_category-37'>
          <label class="selectit">
            <input value="37" type="checkbox" name="cat_project_category[]" id="in-project_category-37" />isoleren</label>
        </li>

        <li id='project_category-38'>
          <label class="selectit">
            <input value="38" type="checkbox" name="cat_project_category[]" id="in-project_category-38" />nieuwbouw</label>
        </li>

        <li id='project_category-39'>
          <label class="selectit">
            <input value="39" type="checkbox" name="cat_project_category[]" id="in-project_category-39" />opbouw</label>
        </li>

        <li id='project_category-40'>
          <label class="selectit">
            <input value="40" type="checkbox" name="cat_project_category[]" id="in-project_category-40" />renovatie</label>
        </li>

        <li id='project_category-41'>
          <label class="selectit">
            <input value="41" type="checkbox" name="cat_project_category[]" id="in-project_category-41" />veranda en serre</label>
        </li>
    </li>
    </ul>
</div>

你也有一个nullpointer异常,尝试先添加它们,然后修复异常并最后清理你的项目来运行它

答案 2 :(得分:-2)

您需要在AndroidManifest.xml

中添加以下权限
  

uses-permission android:name =“android.permission.INSTALL_PACKAGES