Can't run nor debug project but gradle build+install work

后端 未结 11 1333
梦毁少年i
梦毁少年i 2020-12-07 00:32

After update to Android studio 3.6 Canary11 (macOS) I cannot run nor run Debug variants of my project (Release variants working fine).

When I try to run the project

相关标签:
11条回答
  • 2020-12-07 01:01

    When getting a entry name 'kotlin/collections/mapwithdefault.kotlin_metadata' collided error in Android Studio v3.6.1 it helped cleaning the build folders.

    We ended up creating a script for this: cleanBuldFolders.sh

    #!/bin/bash
    
    # Deletes all build folders in the project
    find . -name build -type d -exec rm -rf {} +
    
    0 讨论(0)
  • 2020-12-07 01:02

    I faced the same problem. I just clean and rebuild, and it's working fine after that.

    0 讨论(0)
  • 2020-12-07 01:05
    1. After upgrading Gradle, compilation (debug) failed. I got the compilation error message:

    Entry name 'res/mipmap-hdpi-v4/ic_launcher.png' collided

    1. Tried the article https://medium.com/@elye.project/resources-collision-without-warning-b29294f518c6 by Elye. I am using a library where ic_launcher is also defined. I renamed the ic_launcher according to recommendations in the article, but that did not solve the problem.

    2. Tried to clear the cache by deleting the build and gradle directory, but that did not solve the problem.

    3. Tried to set in gradle.properties:android.useNewApkCreator=false but then Android Studio reports: build.gradle: The option setting android.useNewApkCreator=false is experimental and unsupported.

    4. Since I am not up to using experimental features, I downgraded from:
      Gradle Version: 3.6.1 Android Plugin version: 6.2.1
      to:
      Gradle Version: 3.5.3 Android Plugin version: 5.4.1

    Compilation (debug) now works again.

    0 讨论(0)
  • 2020-12-07 01:05

    I faced the same issue when using Android Studio 4.0 Canary 8.

    I solved my problem by downgrading from:

    Gradle version 3.6.3 to 3.5.3

    Android plugin version 5.6.1 to 5.4.1

    BUT

    I would suggest try these below options before downgrading

    • Delete build folder inside app
    • Clean
    • Rebuild

    If you still face the issue, try Invalidate Cache / Restart

    0 讨论(0)
  • 2020-12-07 01:09

    Delete apk file from subfolders project

    0 讨论(0)
  • 2020-12-07 01:14

    I was facing the same error as MrEngineer13. After hours of struggle turns out you have to delete the built APK files for the project to build another APK successfully

    0 讨论(0)
提交回复
热议问题