android - Android Studio Gradle构建错误-任务:app:packageInstantRunResourcesDebug失败

标签 android sqlite android-studio gradle

我是android studio和Gradle的新手。我有一个项目,我正在从 Assets 文件夹中加载大型SQLite数据库。当我按下run并选择一个模拟器时,android studio开始构建并执行gradle任务。我在执行以下任务之一时遇到错误:

     Error:Execution failed for task ':app:packageInstantRunResourcesDebug'.
    > org.gradle.tooling.BuildException (no error message)

并在控制台的完整错误输出中说:
    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:packageInstantRunResourcesDebug'.
    > org.gradle.tooling.BuildException (no error message)

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or 
    --debug option to get more log output.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 21s       

我不知道这是否是由于数据库很大。这是正在构建的任务的堆栈跟踪:
     Executing tasks: [:app:assembleDebug]

    :app:buildInfoDebugLoader
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:compileDebugAidl UP-TO-DATE
    :app:compileDebugRenderscript UP-TO-DATE
    :app:checkDebugManifest UP-TO-DATE
    :app:generateDebugBuildConfig UP-TO-DATE
    :app:prepareLintJar UP-TO-DATE
    :app:generateDebugResValues UP-TO-DATE
    :app:generateDebugResources UP-TO-DATE
    :app:mergeDebugResources UP-TO-DATE
    :app:createDebugCompatibleScreenManifests UP-TO-DATE
    :app:processDebugManifest UP-TO-DATE
    :app:splitsDiscoveryTaskDebug UP-TO-DATE
    :app:processDebugResources UP-TO-DATE
    :app:generateDebugSources
    :app:javaPreCompileDebug UP-TO-DATE
    :app:compileDebugJavaWithJavac UP-TO-DATE
    :app:mergeDebugShaders UP-TO-DATE
    :app:compileDebugShaders UP-TO-DATE
    :app:generateDebugAssets UP-TO-DATE
    :app:mergeDebugAssets UP-TO-DATE
    :app:packageInstantRunResourcesDebug FAILED
    :app:buildInfoGeneratorDebug

最佳答案

您需要禁用即时运行功能。最新稳定版Android Studio的说明:
文件->设置->构建,执行,部署->即时运行-> [删除复选框]“”启用即时运行到热sap代码...“

关于android - Android Studio Gradle构建错误-任务:app:packageInstantRunResourcesDebug失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48207609/

相关文章:

android - 创建的 Smack Cache Executor 线程过多

java - MySQL 和 SQLite 在 SQL 方面的差异

java - 如何将 android 包导入新的 Android 模块?

android - 如何在 Android 上通过 GPS 跟踪距离?

android - 在 Xamarin iOS 和 Xamarin Android 之间自动转换代码

android - 求教,如何设置 'field'的notnull值'为false?

.net - SQLite 与 Microsoft Access MDB 相比有多快?

sqlite - 我无法在 AIR 应用程序中写入 SQLite 数据库

android-studio - 我的任务的Gradle增量构建:怎么了?

android - 在 Android Studio 的单元测试功能中获取 AndroidTestCase 或 InstrumentationTestCase 的上下文