Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Proguard: Failed to copy mapping file

Discussion in 'Android' started by Dawdlebird, May 3, 2020.

  1. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Using proguard. Not sure how long this warning has been there; I just noticed today because a built stopped copying to my device (I had deleted the game, but it just got disabled, preventing re-installation). Game runs again, but I still see this warning pop up:

    Does anyone have an idea what might cause this or how to solve this?
     
    Last edited: May 3, 2020
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    Which Unity version do you use? Do you use a gradle version included with Unity and the default android gradle plugin version, or did you set custom ones? If you have upgraded your project from an older Unity version and you have a custom build gradle file, you should upgrade it based on the default template in the currently used Unity version.

    This issue is likely caused by the fact that different android gradle plugin versions put final apk / mappings files in a little bit different locations. So Unity expects the file to be in a different location than it actually gets placed. That's a guess.
     
  3. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Hey, thanks for the reply. I'm using 2019.3.1.12f, and I am using the default android gradle plugin. The folder reference in Player Settings ("custom proguard file") also points to the correct location. I don't believe anything has been modified at any point, other than editing the proguard-user.txt file itself.
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    Hi, so as I've expected this is an issue that Unity expects the mapping file to be in a different location than it actually gets placed. This will be fixed in the future, but for now you can manually copy that file after the build. After you make the build, don't close the editor, then check the Temp\gradleOut\launcher\build\outputs\mapping\release\ or Temp\gradleOut\launcher\build\outputs\mapping\debug\ directories based on what configuration you were building. The mapping file will be there. If you want to keep it, make sure to move / copy it from there to somewhere else, since the whole Temp directory will be removed once you close the editor.
     
  5. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Hey, sorry for the late reply, but thanks; will try!
     
  6. Agodesa

    Agodesa

    Joined:
    Aug 3, 2017
    Posts:
    11
    I was able to find it there, thank you!
     
  7. WizardingStudios

    WizardingStudios

    Joined:
    Mar 4, 2017
    Posts:
    13
    Hi, same problem here, please should you give the full path? Where is the Temp directory you are talking about?
     
  8. Agodesa

    Agodesa

    Joined:
    Aug 3, 2017
    Posts:
    11
    The Temp folder is where your Unity project is (where you have Assets, Library and ProjectSettings folders)
     
  9. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    This issue will be fixed in 2019.4.1f1.
     
    Agodesa likes this.