Skip to content

SDL2/Gradle bootstrap with fixes #1071

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

Merged
merged 27 commits into from
Sep 30, 2017
Merged

Conversation

inclement
Copy link
Member

@inclement inclement commented Jul 2, 2017

This PR is an extended version of tito's #1042 , which did not work for me without the new changes.

The main changes are:

  • Moved .so files from src/main/jniLibs back to libs, and added this location explicitly to the build.gradle. I couldn't get the libs to be loaded properly without this change (although it might also work to move all of them, not just the libpython, and again add the location explicitly to build.gradle).
  • Removed the NDK build stuff from the build.gradle file. This seemed to run the whole build a second time, and isn't necessary as p4a already does the ndk-build step as part of the SDL2 recipe. This also seemed to make some of the changes to Android.mk unnecessary.

Can anyone test if this new version works for them?

@inclement
Copy link
Member Author

@tito Would you be able to check if this PR works for you? I'm not sure if I've missed something.

@inclement
Copy link
Member Author

The sdl2_gradle bootstrap now supports both ant and gradle, either via a command line parameter or by automatically detecting if gradle will work by checking if it is present and that the android-sdk build-tools are new enough.

I intend to finally merge these changes back into the sdl2 bootstrap, so that the one bootstrap can take care of both build systems.

@inclement
Copy link
Member Author

I've now moved everything back to the sdl2 bootstrap, which supports both gradle and ant as available. I intend to merge it right after releasing, since it may break things and need a little time to fix any problems that come up.

@KeyWeeUsr
Copy link
Contributor

One of the changes fixed the license issue I think, because I don't experience it anymore. I got further with the build, but still couldn't build an app. I've never experienced this error, so I don't know what to look for.

Also, I'm not sure, but think some recent changes also removed --sdk argument compatibility, so I needed to run the building command from buildozer myself (w/o the SDK argument). Then I got the linked error.

@inclement
Copy link
Member Author

Interesting error, not sure what's going on there. https://stackoverflow.com/questions/43916513/gradle-build-exception-aapt-process-not-ready-to-receive-commands seems to indicate that it's something to do with gradle versions, which seems understandable but probably needs some research to fix properly.

@jb1123
Copy link

jb1123 commented Aug 2, 2017

For me it has failed. I have downloaded pull request with:
git fetch upstream pull/1071/head:sdl2_gradle_inclement
git checkout sdl2_gradle_inclement
installed it from source
pip install --user -e /home/jb/python/ve27/python-for-android
Tried to build apk but it has failed to complie SDL2 recipe - see attached log.
error_log.txt

Update 1
It works with 'ndk_version' : 'r13'. Problem described above is with 'ndk_version' : 'r15c'
Update 2
on_pause()/on_resume is not working. Paused application restores empty screen.

@inclement
Copy link
Member Author

@jb1123 Thanks, this is useful to know.

@inclement inclement modified the milestones: 0.6, 0.5 Aug 26, 2017
@inclement
Copy link
Member Author

@KeyWeeUsr Do you still get the error you posted at https://gist.github.com/KeyWeeUsr/95e60ebf4ab392abba9c559349a513ac ?

@inclement inclement force-pushed the sdl2_gradle_inclement branch from c181b83 to 3c9b5ea Compare August 28, 2017 17:03
@inclement inclement force-pushed the sdl2_gradle_inclement branch from 3c9b5ea to 971ed44 Compare September 28, 2017 23:36
@inclement
Copy link
Member Author

I had no problems getting this working in an Ubuntu VM, so I'm inclined to merge it after doing some final tests. I won't be surprised if there are still issues, but at this point I think it's better to make people come across them in master since they won't get found otherwise.

@inclement inclement merged commit e5ab231 into kivy:master Sep 30, 2017
opacam added a commit to opacam/python-for-android that referenced this pull request Nov 25, 2018
The webview bootstrap was initially made thinking in the old python2 recipe and due to the recent changes in python2 build system, it was broken. Also, it was using the ant's tool to build the apk and this was causing troubles while compiling with latest android ndk (kivy#1069)...so...here we move the apk build tool from ant to gradle (because is the same build system than the sdl2's bootstrap). This changes will allow us to grant python3's compatibility for webview's bootstrap in a near future.

The gradle changes are based on previously work done by @inclement and @tito for sdl2 bootstrap while introducing gradle (kivy#1071).
opacam added a commit to opacam/python-for-android that referenced this pull request Nov 25, 2018
The service_only bootstrap was broken since the update of python recipe, plus it was using the ant's tool to build the apk and this was causing troubles while compiling with latest android ndk (kivy#1069)...so...here we move the apk build tool from ant to gradle (the same build system than the other bootstrap: sdl2 and webview). This changes will allow us to grant python3's compatibility for service_only's bootstrap in a near future.

Also with this update, some of the args disabled for this bootstrap has been enabled (e.g.: application's icon or  the aar dependency). The presplash was leaved out from those additions but maybe it should be included as well.

The gradle changes are based on previously work done by @inclement and @tito for sdl2 bootstrap while introducing gradle (kivy#1071) and on the recent changes applied to the webview's bootstrap.
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.

5 participants