Android项目中的循环依赖

时间:2018-10-22 12:39:20

标签: android gradle android-gradle circular-dependency

我正在开发基于pjsua2库的应用程序。 当我在Oreo以下的任何版本的android上运行该项目时,它都可以正常运行,并且能够调试该应用程序。但是,当我尝试在装有Android版本Oreo的新手机上调试它时,出现以下错误

Circular dependency between the following tasks:
:app:checkManifestChangesDebug
\--- :app:instantRunMainApkResourcesDebug
     \--- :app:transformClassesAndDexWithShrinkResForDebug
          \--- :app:transformDexArchiveWithDexMergerForDebug
               +--- :app:preColdswapDebug
           |        \--- :app:incrementalDebugTasks
           |                 +---:app:transformClassesAndClassesEnhancedWithInstantReloadDexForDebug
               |         |    \--- :app:transformClassesWithInstantRunForDebug
               |         |         \--- :app:checkManifestChangesDebug (*)
               |         \--- :app:transformClassesWithInstantRunForDebug (*)
               \--- :app:transformClassesWithDexBuilderForDebug 
                    +--- :app:preColdswapDebug (*)
                    \--- :app:transformClassesWithInstantRunForDebug (*)

(*) - details omitted (listed previously)

我认为这归因于android版本,但我确实需要解决此问题。 因此,如果有人可以提供帮助,我将非常感激

1 个答案:

答案 0 :(得分:4)

我实际上遇到了同样的问题,我发现有两种方法可以在等待解决此问题的真正方法时绕过它。

1)禁用即时运行:  ->设置/构建,执行,部署/即时运行(取消选中“启用即时运行”

2)如果在应用程序级别build.gradle中将其设置为true,则禁用rinkresources

shrinkResources false

我仍在寻找一种更好的方法来解决此问题...

相关问题