完成构建AndroidStudio后无法运行项目

时间:2016-06-16 06:51:52

标签: android android-studio android-gradle

在我的项目中,我能够成功构建但是当我尝试运行该项目时,我收到以下错误

 Gradle build finished in 56s 112ms

 EmptyThrowable: The APK file /home/dell/git/my-seat-app-current/App/build/outputs/apk/App-dev-debug.apk does not exist on disk.

 Launching App
 The APK file /home/dell/git/my-seat-app-current/App/build/outputs/apk/App-dev-debug.apk does not exist on disk.
Error while Installing APK

当我点击空Throwable时,它将打开一个包含以下细节的对话框

com.intellij.openapi.diagnostic.Logger$EmptyThrowable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:117)
    at com.android.tools.idea.run.tasks.DeployApkTask.perform(DeployApkTask.java:92)
    at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:103)
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

4 个答案:

答案 0 :(得分:0)

不知道您的应用是否有任何jni / native部分,但我今天使用最新的实验性gradle插件(0.8.0-alpha3)体验过这一点。

简单地回到alpha2为我修复它:

dependencies {
    classpath 'com.android.tools.build:gradle-experimental:0.8.0-alpha2'
}

答案 1 :(得分:0)

当我在gradle中替换下面的行时,它工作正常

  defaultConfig {
        minSdkVersion project.ext.testMinSdkVersion
        targetSdkVersion project.ext.testTargetSdkVersion
        versionCode 1
        project.ext.set("archivesBaseName", "mytestApp" +
                getSprintVersion() +
                getProductionVersion() + "-" +
                getDate() + "-" + getTime());
       }

 defaultConfig {
        minSdkVersion project.ext.testMinSdkVersion
        targetSdkVersion project.ext.testTargetSdkVersion
        versionCode 1
        project.ext.set("archivesBaseName", "mytestApp");

    }

答案 2 :(得分:0)

您可以尝试按照以下步骤操作:

1检查构建变体

2-clean clean

3档 - >废止     高速缓存/重启

答案 3 :(得分:-1)

听起来你需要同步你的Gradel,点击Android工作室左上角的圆形蓝色箭头,当你将鼠标悬停在它上面时会说同步enter image description here

或者您可以在项目面板中右键单击Gradel项目,然后选择同步gradel。