Uncaught exception [file_open

Then it sounds like the release build didn’t finish. Check further up for another error.

That’s why there’s an error - you tried to call file_open() on a file that doesn’t exist.

Reinstalled everything (including FlashDevelop and Java) and got this:

Caused by: java.io.FileNotFoundException: C:\Users\Desktop\Zephyr\bin\android\release\bin\deps\google-play-services_lib\AndroidManifest.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at com.android.io.FileWrapper.getContents(FileWrapper.java:91)
… 24 more

Problem is, that extension doesn’t have an AndroidManifest.xml, don’t think it’s supposed to have one either.
I pasted one into the folder, that didn’t work either.

Upgrading to the git version of lime again like you recommended the other day.
I’m starting to think the problem lies there.
You told me to copy the ndll files from 4,0,3 into git but I don’t have 4,0,3.
When i tried to install, it says ‘no such version 4.0.3 for library lime’.
I copied the ones from 3,0,3 instead, i think that’s where the problem is.
Where can I get 4.0.3?

Sorry, I meant 3.0.3 instead of 4.0.3.

Ah ok, I feel like less of an idiot now.
I ran ‘openfl setup android’ and got an empty folder called android, put the ndlls in there and got to my next error:

No resource found that matches the given name (at ‘value’ with value ‘@integer/google_play_services_version’).

I’m thinking I should put something like this in the project.xml:

setenv name=“google_play_services_version” value=“x” />

Am I on the right track?

Or should I upgrade android api to 24?

I’ve gone ahead and built a library that imports Google Play Services the “right” way. Try that instead of extension-googleplayservices-lib (you’ll have to delete references like this to completely get rid of it).

Sample import code, assuming you’re only using Google Play Game Services:

<set name="googlePlayGameServices" />
<haxelib name="google-play-services" />

Wow thanks dude,
I had to update java again and got it compiling the debug apk with your lib installed
But it gives the same error when trying to use my self signed certificate.

Called from ? line 1
Called from CommandLineTools.hx line 1426
Called from CommandLineTools.hx line 25
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 635
Called from lime/project/PlatformTarget.hx line 113
Called from lime/tools/platforms/AndroidPlatform.hx line 193
Called from C:\HaxeToolkit\haxe\std/neko/_std/sys/io/File.hx line 62
Called from C:\HaxeToolkit\haxe\std/neko/_std/sys/io/File.hx line 50
Uncaught exception - [file_open,C:\Users\Desktop\Zephyr\bin\android\release/bin/app/build/outputs/apk/app-release.apk]

That apk folder has app-debug.apk, app-debug-unaligned.apk and Zephyr-debug.apk but no app-release.apk

Ok I changed this:
template path=“templates/AndroidManifest.xml” rename=“src/main/AndroidManifest.xml” if=“android” />
to this:
template path=“templates/AndroidManifest.xml” rename=“app/src/main/AndroidManifest.xml” if=“android” />

That did the trick, compiling release version now with no errors.
But now I’m at a loss at how to implement google play games services.
Was hoping to use the API provided by that guys extension.
Can I just copy paste it into your extension or can you recommend another compatible extension?

This is very odd.
I copy pasted the Sempai google play games classes into my src folder to see if I they’ll work outside of the extension.
Added a textfield for output when running release version.
Textfield doesn’t show up.
So I changed some of the text of the buttons to see if they were being updated between compiles.
No change.
It’s like it’s just telling me the app has compiled and then running an old version of it.
I even tried uninstalling the app from my phone between builds, no change.
No idea what’s going on

This is the error I get when running “openfl test android -release” from the command line:

deleted everything in the bin folder and started again.
It’s went back to the file_open error and failed to create the bin\android\debug/bin/app/build/ folder.
The closest thing I’m getting to a compiler error is this warning:

./src/lime/graphics/format/BMP.cpp: In static member function ‘static haxe::io::Bytes lime::graphics::format::BMP_obj::encode(lime::graphics::Image, lime::graphics::format::BMPType)’:
./src/lime/graphics/format/BMP.cpp:571: warning: large integer implicitly truncated to unsigned type
./src/lime/graphics/format/BMP.cpp:605: warning: large integer implicitly truncated to unsigned type
./src/lime/graphics/format/BMP.cpp:711: warning: large integer implicitly truncated to unsigned type
./src/lime/graphics/format/BMP.cpp:745: warning: large integer implicitly truncated to unsigned type
./src/lime/graphics/format/BMP.cpp:813: warning: large integer implicitly truncated to unsigned type

Commented out all the google play stuff in the project.xml and got it to compile with this error:

:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: C:\Users\Liam\Desktop\Zephyr\bin\android\release\bin\app\src\main\java\org\libsdl\app\SDLActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

I think that might be where the problem is, but I’ve been wrong before…

Those are all just warnings. It would be nice if the Lime devs fixed them, but they aren’t your problem.

Usually uninstalling and doing a clean rebuild is enough, but I know of one case where it actually isn’t. If your device has multiple users, then it may end up uninstalling for one user, but remaining for everyone else. It’s possible to find an “uninstall for all users” option somewhere, but a more direct solution is to use ADB:

> adb uninstall com.your.package.zephyr

Ok, I just went and double-checked, and it turns out there’s a good reason to find “-debug.apk” in the release folder. It’s only supposed to say “-release.apk” if you include a certificate. It sounds like you built without a certificate at first (producing the -debug versions), and later recompiled with one.

Again, I’m left suspecting something went wrong during the second build, but I don’t know what because the warnings you posted aren’t enough to stop a build.

It compiles when I comment out these lines

!-- Google Play Extension -->
set name="googlePlayGameServices" if="android" />
haxelib name="google-play-services" if="android" />
!-- Templates -->
template path="templates/AndroidManifest.xml" rename="AndroidManifest.xml" if="android" />
template path="templates/AndroidManifest.xml" rename="app/src/main/AndroidManifest.xml" if="android" />
template path="templates/build.gradle" rename="app/build.gradle" if="android" />
setenv name="GOOGLE_PLAY_GAMES_ID" value="253066465387" if="android" />
certificate path="zephyr-release.keystore" alias="antehero" password="password" if="android" unless="debug"/>

I tried introducing those lines back in one at a time to see which one is causing the problem but it’s very temperamental. I actually have no idea what my project xml should look like for an android app. The only tutorial i’ve found on the subject is about 4 years old. Sent you a pm about it.

Rebuilding after a proper uninstall reveals it is the ‘certificate’ line which is causing the problems

Not too surprising. When you rebuild like that, do you get the “file_open” error, or something else?

Does it still produce files like app-debug.apk? (Delete those files and rebuild if you aren’t sure.)

With those lines still in the project xml, it produces nothing but the file_open error.
When they are commented out it produces app-debug.apk, app-debug-unaligned.apk and Zephyr-debug.apk

Turns out it wasn’t updating the game at all when those lines are included not even the .hx files.
It goes through the whole process of compiling and then opens the old Zephyr-debug.apk.
If it’s there from the previous build that is. Otherwise it just gives the file_open error.

So it’s not just the certificate line causing the problems, I thought it was because it was running the old Zephyr-debug from previous builds when I had the certificate commented out.

Well that’s interesting. So the build is definitely failing (produces no output file), but then it just keeps going (tries to open app-release.apk).

I notice that these are two distinct parts of the build process. In fact, lime test android is composed of two different phases (actually three, but only two matter here). lime build android is the phase that compiles your Haxe code, compiles the resulting C++ code, processes your templates, and runs Gradle. lime run android is the phase that tries to install app-release.apk (after renaming it “Zephyr-release.apk”). To test this, try lime run android, and you should see the exact same file_open error, except without waiting for it to build.

So somewhere along the line, lime build android fails, and it doesn’t return an error code. If it did return an error code, Lime wouldn’t proceed to the lime test android phase.

If Gradle isn’t giving you an error, then it’s worth running Gradle with various flags to see if you can find any clues. To do this, navigate to android/release/bin and run this:

> gradlew assembleRelease
> gradlew assembleRelease --stackTrace
> gradlew assembleRelease --stackTrace --info
> gradlew assembleRelease --stackTrace --verbose

These are arranged from least to most verbose. (And believe me, --verbose is extremely verbose, so hopefully you’ll spot something before then.)

You might want to start with “gradlew assembleDebug” so you know what a successful build looks like. And if you run that in a separate window, you can do a side-by-side comparison.