Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building Player: IOException: Failed to Move File

I keep getting this error when I try to use my .aar plugin created in android studio on Unity 3d

Error building Player: IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\app-release\classes.jar' to 'Temp/StagingArea\android-libraries\app-release\libs\classes.jar'.
like image 947
Tayo Joseph Avatar asked Nov 29 '22 23:11

Tayo Joseph


2 Answers

Use provided scope in gradle.

https://sinking.in/blog/provided-scope-in-gradle/

dependencies 
{
    provided fileTree(dir: 'libs', include: ['*.jar'])
}
like image 152
Alex Yermoshenko Avatar answered Dec 04 '22 12:12

Alex Yermoshenko


You need to remove 'libs/classes.jar' in your aar(use your favorate archive manager, it's just ZIP file), since Unity will inject it by self. Unity will fail if there's already one.

like image 40
Proton Avatar answered Dec 04 '22 12:12

Proton