Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Cannot access a file in the destination directory #90033

Closed
gaoyan2659365465 opened this issue Mar 30, 2024 · 9 comments
Closed

Android Cannot access a file in the destination directory #90033

gaoyan2659365465 opened this issue Mar 30, 2024 · 9 comments

Comments

@gaoyan2659365465
Copy link

gaoyan2659365465 commented Mar 30, 2024

Tested versions

4.3.dev5

System information

Windows10

Issue description

Android export error

editor/export/editor_export_platform.h:182 - 导出: 无法复制并更名导出文件:
  
  
  > Configure project :
  WARNING: The option setting 'android.overridePathCheck=true' is experimental.
  The current default is 'false'.
  
  > Task :copyAndRenameDebugApk FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':copyAndRenameDebugApk'.
  > Cannot access a file in the destination directory. Copying to a directory which contains unreadable content is not supported. Declare the task as untracked by using Task.doNotTrackState(). For more information, please refer to https://docs.gradle.org/8.2/userguide/incremental_build.html#disable-state-tracking in the Gradle documentation.
     > Failed to create MD5 hash for file content.
  
  * Try:
  > Run with --stacktrace option to get the stack trace.
  > Run with --info or --debug option to get more log output.
  > Run with --scan to get full insights.
  > Get more help at https://help.gradle.org.
  
  BUILD FAILED in 2s
  1 actionable task: 1 executed
  
  Attempting to parent and popup a dialog that already has a parent.

Gradle
If an error occurs in the English path, it can be exported in the Chinese path
The same project can be exported normally in 4.3dev2

Steps to reproduce

Create a new empty project, direct Android export

Minimal reproduction project (MRP)

without

@ReneSerra
Copy link

Same issue (Godot 4.2.2) when exporting an android .apk file.

Workaround : if the export template is also used to "one-click deploy", the similar APK file is created (without error) in the project's sub-directory android\build\build\outputs\apk\debug (in any case, it worked for me).

@Clemkd
Copy link

Clemkd commented Apr 21, 2024

I have the same problem (4.2.2).
In my case, restarting Godot Engine as administrator worked.

@ReneSerra
Copy link

Launching Godot as administrator don't work for me, but found another workaround (or fix ?)...

The error message say "Declare the task as untracked by using Task.doNotTrackState()", so :
- find the build.gradle file (android/build/build.gradle)
- locate the task where the fail occurs (for me : task copyAndRenameDebugApk(type: Copy))
- at the end of the task definition, add the line doNotTrackState("Build failure workaround")
REM : you have to specify a string argument (at your convenience)
- et voila...
REM : the apk generated file is identical to android/build/build/outputs/apk/debug/android_debug.apk

That's the entire task definition :

task copyAndRenameDebugApk(type: Copy) {
from "$buildDir/outputs/apk/debug/android_debug.apk"
into getExportPath()
rename "android_debug.apk", getExportFilename()
doNotTrackState("Build failure workaround")
}

@Gove2004
Copy link

屏幕截图 2024-05-31 114110
want's up?Launching Godot as administrator don't work for me.

@m4gr3d
Copy link
Contributor

m4gr3d commented Jun 10, 2024

Fixed by #90802

@m4gr3d m4gr3d closed this as completed Jun 10, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone Jun 10, 2024
@the-Explorer-fr
Copy link

Fixed by #90802

i have the same prolem didn't understand how to fix it with this link

@ReneSerra
Copy link

Try to replace the "bad" Android build template with the new (fixed) :

  • remove res://android/build directory
  • Project > Install Android Build Template...

@Gove2004
Copy link

I don't know what's going on, but when I try again in a few days, I found out that it works.

@breakmt
Copy link

breakmt commented Aug 13, 2024

Have the same in 4.2.2 stable.
That's why I quit Godot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants