Skip to content

Conversation

luizdepra
Copy link

This PR updates the SDL2 submodule to fix the build problem reported at #1769.

@nesbox
Copy link
Owner

nesbox commented Jan 31, 2022

Unfortunately, the Android build fails with this update
https://github.com/nesbox/TIC-80/actions/runs/1768620530
image

I'll try to fix it later, thanks.

@luizdepra
Copy link
Author

I can try fixing it too. No problem.

Another thing, I think it would be great if the all CI builds runs and reports show here in the PR. So, we contributors could see if there is any problem with our contributed code.

I didn't look at the CI pipeline yet, but I can help you with that if you want.

@nesbox
Copy link
Owner

nesbox commented Jan 31, 2022

I can try fixing it too. No problem.

Great, please, if not difficult :)
As far as I understand, we need to update build/android from the vendor/sdl2/android-project folder.

I think it would be great if the all CI builds runs and reports show here in the PR

I just enabled Actions for PRs in the project settings.
Thanks.

@luizdepra luizdepra force-pushed the fix-sdlw-version branch 2 times, most recently from b092a08 to ad939f0 Compare January 31, 2022 23:22
@luizdepra
Copy link
Author

luizdepra commented Feb 1, 2022

So, @nesbox. I added pull_request into GH Action to test the build on my fork. Tell me if you want to remove it.

Well, the build is still failing, but I got some progress. I updated the using the sdl2/android-project files, but removed the JNI related things. I noticed that libhdiapi was removed from the example code, and many lines of java code were modified too. Could you please check if everything is fine about this?

But, there is a new error here because Gradle was updated too.

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

If I understood right, we need to update the Java version on nesbox/android-tic80. I think only you could make a new release of this container image.

Or, I could only update the code and keep gradle in the same version.

@luizdepra
Copy link
Author

luizdepra commented Feb 1, 2022

Maybe I got everything wrong. I think the real problem is that libhdiapi is missing. I'm going to try the android build on my machine to see if is it the real issue.

@nesbox
Copy link
Owner

nesbox commented Feb 1, 2022

I also think that we need to update the Java version on nesbox/android-tic80 (I'll try later), but as a temporary solution, we could try to keep Gradle in the same version.

@luizdepra
Copy link
Author

I tried not updating Gradle and got the same error. See here.

I don't know whether the Android Build should ship or not with hidapi. I know that the linking step of lib/libtic80.so is failing, so maybe we should add or remove something related to hidapi from CMake rules.

@nesbox
Copy link
Owner

nesbox commented Feb 1, 2022

maybe we should add or remove something related to hidapi from CMake rules.

Seems yes, pls remove the CMakeLists.txt:984 target_link_libraries(tic80 hidapi) line.

@luizdepra
Copy link
Author

Yeah! It is fixed!

First, sorry for the noise in this PR. Also sorry for my editor removing lots of trailing whitespaces and reformatting a .yml file causing more changes. I can revert it back if you want, but IMHO formatting and triming spaces are not a bad thing.

It wasn't need to update the build/android folder at all. The relevant changes are in the CMakeLists.txt file, at lines 474 and 985. Basically, I removed hidapi from the linking step and forced SDL2 to be compiled with -fPIC for Android.

@nesbox
Copy link
Owner

nesbox commented Feb 2, 2022

Great, build is fixed, but unfortunately, the app doesn't start :(
Seems, we have to update all the Java files too.

@luizdepra
Copy link
Author

Done!

Is there a way I could download the generated artifacts from the CI build to test it?

@nesbox
Copy link
Owner

nesbox commented Feb 2, 2022

Is there a way I could download the generated artifacts from the CI build to test it?

Sure, please go to Actions https://github.com/nesbox/TIC-80/actions, select your commit and you will find the artifacts at the bottom of the page.
https://github.com/nesbox/TIC-80/actions/runs/1784048184

Thank you for the help.

@luizdepra
Copy link
Author

I think it is fixed now. The Android build launched and ran without errors on my phone.

The app was still trying to load hidapi, so I removed the entry inside getLibraries from TIC.java.

Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for the help.

@nesbox nesbox merged commit a505ca5 into nesbox:main Feb 3, 2022
@nesbox nesbox linked an issue Feb 3, 2022 that may be closed by this pull request
@luizdepra luizdepra deleted the fix-sdlw-version branch February 6, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDL2 Compilation Error on Linux Wayland
2 participants