Search Unity

UnauthorizedAccessException: unity-ads.aar on Gradle Export

Discussion in 'Android' started by chrisrolls55, Mar 21, 2018.

  1. chrisrolls55

    chrisrolls55

    Joined:
    Nov 26, 2014
    Posts:
    14
    Hi, has anyone come across this problem when building a Gradle Export?

    Error details below:

    UnauthorizedAccessException: Access to the path "[PROJECT PATH]Temp\StagingArea\aar\unity-ads.aar" or "[EXPORT PATH]\libs\unity-ads.aar" is denied.
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:124)
    UnityEditor.FileUtil.UnityFileCopy (System.String from, System.String to, Boolean overwrite) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.cs:207)
    UnityEditor.Android.AndroidProjectExport.CopyFile (System.String source, System.String target)
    UnityEditor.Android.AndroidProjectExportGradle.AddAARDependencies (System.String libsProjectPath)
    UnityEditor.Android.AndroidProjectExportGradle.ExportWithCurrentSettings ()
    UnityEditor.Android.AndroidProjectExport.Export (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String targetPath)
    UnityEditor.Android.PostProcessor.Tasks.ExportProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:272)
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)

    Unity version 2017.3.1f1
    Unity IAP is up to date.
    Have clicked User Proguard File under Publishing Settings but doesn't clear errors.

    Any ideas as to whats causing the error would be appreciated.
     
  2. LingXin

    LingXin

    Joined:
    Aug 14, 2017
    Posts:
    1
    • I remember having the same problem. After I delete the export folder and reexport, the problem is disappear.
     
  3. tadejP

    tadejP

    Joined:
    Jan 24, 2017
    Posts:
    1
    I'm having the same problem and the above solution isn't working. Anyone found a different solution?
     
  4. uitel2

    uitel2

    Joined:
    Oct 23, 2017
    Posts:
    7
    I still have the same problem... :(