-
Notifications
You must be signed in to change notification settings - Fork 506
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
Copy path wrongly set and error in build options #287
Comments
Hi, I just started with flutter development and nw integrated unity. I ran into the same issue and edited the build.cs a littlebit. the export works for now. But in my case handling with the integration of Unity into Flutter/Android feels a bit wonky. I also tried to edit all the dependencies and manifest from scratch, so that I could start from a clean Flutter project. But unfortunately I am too much of a noob to know what I was doing, and I couldn´t get the dependencies to work properly. I am glad my cs editing works now. I know, this has nothing to do with Flutter/Unity, but I hope that someone could make a deep dive (or point to a good tutorial) reagarding build.gradle, AndroidManifest (merging) SDK versions etc. Keep up the good work to all the plugin devs! Thank you!! B and herés the whole script. |
@juicycleff I'm also running in the exact same error. Have you any solution for this problem? |
Hi @mathtasatlime theres a v4 branch where I am fixing a lot, you can test it out will release fir alpha soon. Aside I have not seen this error, and I've done multiple exports, what version of unity are you using? |
Thanks @juicycleff ! Steps:
|
@mathtasatlime its weird as I have exported fir that exact version, did you select export Android or Export Android Plugin |
definitely export Android. I successfully used the export function several times in last autemn. Yesterday I tried it again and the errors occured. |
I had this same issue but the fix was super easy. This comment fixed it for me: #234 (comment) |
Hi, it is a simple path error in the build.cs script. It tries to make a path in the apk file. just overwrite the build.cs with this: Sorry git code snippet doesn´t work. |
Oh I am Sorry, I hardcoded my project folder . you might need to change it. |
Damn it, can somebody explain how to use this github codesnippe t thing correctly ? :D |
It fixed it for me as well! Thank you a lot 👍 |
btw, do I have to change to BuildOptions.None for a release build ? |
work with me |
i suspect there is still an error where resources are copied: looking at the unity project directory, the subtree "/launcher/src/main/res" is inside <unity_project>/Temp/gradleOut/ so shouldn't we replace the apkPath here with the aforementioned gradleOut subfolder? |
Describe the bug
First of all, love it that there is finally support for adding Unity to flutter!
Now for the bug, the issue is twofold
A clear and concise description of what the bug is.
To Reproduce
When pressing Flutter > Export Android, line 55 of
build.cs
will crash. This is the exception thrownI have manually been editing stuff and the problem lies with defining
var options = BuildOptions.AcceptExternalModificationsToPlayer;
. It seems that overwriting it withoptions = BuildOptions.None;
at least mitigated it, but I assume that is not something a user actually needs.With this new options set, retrying Flutter > Export Android a new issue arises, this is the ouptut
I tracked the issue and the error can be traced back to
build.cs
line 23DoBuildAndroid(Path.Combine(apkPath, "unityLibrary"), false);
This Path combines
apkPath
which isD:\repositories\my_flutter_project\unity\MyUnityProject\Builds\MyUnityProject.apk\
and then tries to create a subfolder, yet you cannot create a folder inside a file. So I ASSUME the intended directory would beD:\repositories\my_flutter_project\unity\MyUnityProject\Builds\unityLibrary\MyUnityProject.apk\
Expected behavior
The build succeeds and the copy is done to wherever the plug expects it to be.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: