Hello everyone,
I’m pretty new to Haxe and OpenFL. I’m working on an app to better learn the language and see what I can make with it. Currently, I am having an issue building my application for iOS and Android.
I am using the command lime build ios -simulator -Dsource-header=haxe
to build the app for iOS. When I try to run the app in Xcode to run it on an emulator there is an issue with a try-catch statement I use to check for a file.
Using lime build android
, it goes through the list of stuff it’s exporting for the build but in the end it gives an error when trying to download Gradle (at the bottom of the thread).
I love the Haxe language and would love to use this for future projects, if anyone has had this issue and/or knows the solution please let me know. Thank you
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-2.10-bin.zip
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1913)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
http://services.gradle.org/distributions/gradle-2.10-bin.zip
It is now https and not http. So try to find the manifests with this link and replace with https 
Thank you, I will test that. I was gonna attempt that but couldn’t figure out where the file with the link was.
Alright, for anyone else having this issue. Thanks to the help from yoplalala, I was able to find where the file is located.
Inside of your haxe installation area (on mac it should be under /usr/local/lib/haxe/lib/lime) search for ‘gradle-wrapper.properties’. Open with a text editor and change distributionUrl=http\://services.gradle.org/distributions/
to distributionUrl=https\://services.gradle.org/distributions/
The Android should be fixed in Lime 7.7 
What is the code that is failing on iOS? Perhaps the path you are trying to load is unavailable?
Thanks for the reply. The problem with iOS is exactly because the file path is unavailable. I’m saving the file path as “./file.txt”. I couldn’t figure out a way to use the “./” Path under the file.exists function, so I used a try catch statement which works for the build on my Mac. I’m assuming it doesn’t work the same way under C++/iOS
Perhaps the applicationStorageDirectory
path would be the best one to use in this case?
Actually, this is exactly what I was searching for when I came across someone recommending the “./” Path. Thank you for the help
Before I go and make a new post. I was able to build and run with iOS thanks to your suggestion. However, now I am getting a scaling issue on iOS. I have tried to run the program with fullscreen enabled but it doesn’t change. The application only runs at what looks like 1/8th scale.
Do you have a listener likestage.addEventListener(Event.RESIZE, onResize);
and respond when the stage resizes?
Thanks 
I do not, what would I add to the onResize function to scale it up?
Do you use stage.stageWidth
or stage.stageHeight
at some point? When Event.RESIZE
dispatches from the stage these dimensions have changed.
Here’s a quick example:
function draw():Void
{
graphics.clear();
graphics.beginFill(0xFF0000);
graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
}
...
draw();
stage.addEventListener(Event.RESIZE, onResize);
...
function onResize(event:Event):Void
{
draw();
}
… when the stage has resized we draw again using the new stage width and height to properly handle the new screen size