-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Google requiring API Target 26 in Aug/Nov 2018 #1219
Comments
Looking into this now, when setting target API as as 26, it tries to download:
which fails as this file does not exist. The one below does, so that's why it works with sdk 23.
So google have altered the path of the downloads? It also appears they have changed the location of some files and deprecated the "./android" command which now says you should use the "bin/sdkmanager" tool instead to install sdk's. But I can't find any mention of where they have moved the sdks for downloading. It seems "buildozer/target/android.py " file would need to be changed to use these need tools? |
Google post mentioned at the beginning of this discussion reads: In order to provide users with the best Android experience possible, the Google Play Console will require that apps target a recent API level:
Existing apps that are not receiving updates are unaffected. Developers remain free to use a minSdkVersion of their choice, so there is no change to your ability to build apps for older Android versions. We encourage developers to provide backwards compatibility as far as reasonably possible. Future Android versions will also restrict apps that don't target a recent API level and adversely impact performance or security. Current p4a documentation says ndk r7, SDK 14 - this is years behind current versions. I've tried to build app with SDK=26 and NDK 15c but it has failed. API 27 requires NDK 16, since its platform is not supported in 15c. I haven't tried to use it but I presume it will fail. I've notices p4a uses gcc, gcc was deprecated in NDK r11 and replaced by Clang. Android development team retired ant form SDK a year ago (see https://stackoverflow.com/questions/42912824/the-ant-folder-is-suddenly-missing-from-android-sdk-did-google-remove-it). P4a adopted gradle only last summer. It looks there is plenty to be done and not much time left to catch up. Fortunately Google made revamp easier: it only makes sense to use latest SDK/NdK while building and Android app... |
This seems to be the biggest issue facing Kivy (at least for Android devs). Is there some hope that there will be a re-vamp to support SDK 26+? In August, just 3 months away, no one will be able to create a new Kivy app for Android, and in November, any existing apps will be stuck as-is until/unless this is addressed. I need to figure out what I'm doing for current and in-development apps asap. Do we need a bounty? |
Unless someone steps in to do the work (which would be welcome, and I can give some guidance), this is waiting on me having some serious time to work on p4a. I hope to get to it soon enough, but I'm not going to make any guarantees right now. Edit: The hard part as far as I'm concerned is moving to clang. This probably shouldn't actually be a big issue, but I think it's the most unknown quantity involved. |
@inclement. I would be happy to help out here, but it's not an area I am familiar with. I was going to take the following approach: a. Get a VM building against API 27 on an 18.04 Mate Ubuntu OS using AndroidStudio for the SDK installation. I think it's urgent to get a working build VM so the deadline is not a do-or-die. The full solution can then follow in time? edit: I should probably try as use the commandline tools to install the sdk's, as we will probably need to use those via buildozer for the final solution? |
Sounds great to me!
…On Fri, May 11, 2018 at 5:31 AM Richard Larkin ***@***.***> wrote:
@inclement <https://github.com/inclement>. I would be happy to help out
here, but it's not an area I am familiar with. I was going to take the
following approach:
a. Get a VM building against API 27 on an 18.04 Mate Ubuntu OS using
AndroidStudio for the SDK installation.
b. Once that is working, clean up, snapshot that and make it publically
available for those who need it.
c. Dig into the the python-for-android and buildozer parts that need to
automate this process
I think it's urgent to get a working build VM so the deadline is not a
do-or-die. The full solution can then follow in time?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKTLxybbp6nWO0_nTmyvmsk1o0HArVaLks5txYScgaJpZM4RZ5U5>
.
|
From my point of view, this issue is not with creating a VM but with changing p4a's code to support the latest NDK and SDK. The important steps (which can be done semi-independently) are:
|
Yes, the VM is my thing for a few reasons. I wanted to (a) check building works on 18.04, (b) be able to experiment with safe snapshots and (c) be able to distribute a working build VM. But that need not concern you. I will post here when I hit issues and need your assistance. If you need to make changes to p4a, you could perhaps do that on a branch that I can pull and test on. I can also push there with any changes I need to make. I will try with sdk = 27 in the buildozer.spec. You mention a different NDK? What should that be? Lastly,with regards to gcc vs. clang, don't know much but am willing to learn if you can point me to some docs on changes that will need to be made, which version I need to install etc. I may need a bit of baby sitting getting started, but will document my learning so this whole process is a bit less "black box" like. I think many people would like to help, but it's not at all obvious how to on a project this size. And it's a bit daunting getting started when no docs exists. I know you do tons, and would like to help relieve you, but how to do that is the question...:-) |
I just mean the latest NDK release from https://developer.android.com/ndk/downloads/ , currently r17. The main change is likely to be the need to move to clang, I don't expect anything else in particular to break.
On p4a's side, it currently chooses a gcc toolchain to use, and uses the path to that later in the build process. It does this here. I think this needs to be changed to look for the clang toolchain instead. Beyond that, I would basically proceed by trying to change it and seeing what breaks. I don't have a deep idea about what will need doing. There is some clang documentation at https://developer.android.com/ndk/guides/standalone_toolchain#working_with_clang , and I've found before that since many projects have had to make the same change there are plenty of questions already asked online about the problems that come up. Just to note, while this does need doing, NDK r16 should actually work currently using gcc. I don't think this is going to break in the near future, unlike targeting older apis, although moving to clang is obviously still important. |
Okay, so I've got the API-27 SDK installed and unzipped the latest NDK. Working from buildozer master.
When I run 'buidozer android debug', I get. I am using the default-jre/default-jdk with ubuntu 18.04, which seems to be Java 11. Should I be using another java version? Or how to fix? |
This error results from using a recent SDK with older versions of python-for-android, but it should be okay if you use p4a master. Did you set the |
Okay, I have done a git clone of https://github.xom/kivy/python-for-android into /home/kivy/Repos. So the clone lies in /home/kivy/Repos/python-for-android.
and I get
edit: master is definitely checked out in the python-for-android clone. |
Ah, my mistake, the actual issue is that buildozer itself is not compatible with newer SDKs. It's still good that you're set up with p4a master, your clone method is what I'd recommend for working on this, but it isn't the immediate problem The issue is that, as outlined by the message, newer SDKs replaced the android binary with sdkmanager. That means buildozer's attempt to query the sdk list here needs to be changed to use sdkmanager, or ideally to use sdkmanager or android depending on what's available. The correct command is something like |
Running "./android list sdk" gives the same error as does the sdkmanager. So I downgraded to openjdk-8 and it sorted that issue. Now I get a venv issue? https://gist.github.com/Zen-CODE/d2210ec72984eebd48f286d9fc96b315 |
Do you have virtualenv installed? |
But still get same error. |
Is the virtualenv executable in your $PATH, so you get some answer from |
Okay, progress. I now get
Which I think is a cython version issue. Will downgrade cython and try again.... |
Rather than downgrading cython, could you make sure you're using kivy master? You can set |
Still get the same error. It did pull master now. cython version is 28.3. Perhaps a clean or distclean? |
Might be worth it. I do recognise this error as a cython problem that was fixed at some point, so some cython version should definitely work. |
clean fixed that. Now getting to java errors? |
Ah, this is good, it looks like the build is almost completed at the point it fails. This error is new to me, though. It looks like some kind of ssl problem when downloading gradle. Do you get the same message (without the p4a stuff) if you navigate to |
Downloading gradle now. Fixed via the 18.04 tip here: https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty |
Oh, nice find, I've never seen anything like it before. |
Built!!! :-)
Will test shortly |
Thanks for working on this guys! Hopefully there's a recap or updated build
process down the line, but I'm really looking forward to upgrading my apps
to the latest sdks. I haven't had to deal with runtime permissions requests
on Android yet, but I'm guessing we'll need to update (for instance) the
plyer gps for android to handle this permission request like it already
does on iOS :-P
…On Fri, May 18, 2018 at 3:07 PM Richard Larkin ***@***.***> wrote:
Built!!! :-)
# Android packaging done!
# APK myapp-0.1-debug.apk available in the bin directory
Will test shortly
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1219 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKTLx5AJSEuhWzSt0Dm_ZjMVaDHrn1RQks5tz0YXgaJpZM4RZ5U5>
.
|
The APK installs but the app crashes. Will launch with buildozer and post the logs....
|
@OptimusGREEN getting this folder through jnius is slow, but you only need to do it once. Just store the results in some StringProperty and use it everywhere. |
Okay, I can confirm the build APK per StaceyMAI's procedure runs without the ftello error AND is accepted by google. Yay. Thanks all. @inclement. You mentioned a config file that incorrectly stores the previous config. Which one? If you give me some pointers, I can try to prepare a PR to fix that? |
|
@clevermindgames I modified build.tmpl.gradle as you suggested and that seems to solve the need to find play-services-ads as my log shows it's been downloaded during the build, but now I've got a bunch of these errors for what seems like all of the various android widgets:
Not sure if it's related to the kivmob/admob changes or not, but I don't get these errors and successfully build when I don't make those changes. Edit: Been poking around a bit, when I go to the directory and open up the .xml file(s) indicated in the error messages I'm getting, I'm finding the line that the error is referring to: |
@tkuam this error basically means your build tools are incompatible with com.android.support:appcompat version. I will write up a more detailed guide how to get it to work with all the moving pieces put together in the next couple of days |
@clevermindgames okay yeah that's the conclusion I came upon after doing some googling. Thanks for working on a detailed guide. In the meantime I'll see if I can't mess around with the build tools version and get it working. |
@tkuam Here is the guide: http://quadropoly.com.au/kivy-and-admob-for-android-api-27/ |
Hello, @StacyMAI! I was reading through these comments and I noticed you mention "aeabi_memclr8" When I try to build my app, it compiles the debug APK but crashes at start. I read the logcat file and it came back with: Would you, or anyone else, know how to fix this issue? Thank you! |
@Petar-Luketina I think this issue is likely to be caused by compiling against an api level higher than your device supports. There isn't currently a good way around this, it's a bug in p4a, although there are workarounds (I think discussed earlier in this thread). |
That's better news! Thanks @inclement . Would the app work if I uploaded it on to the app store, then downloaded it on the same phone from there? UPDATE: Here is the error logs from Google:
Any insight? |
@Petar-Luketina have you tried this ? |
Ah, I skimmed over the part that said to make the 19 API then delete the dists and re-build to API 27, my mistake. It works fine on debug mode, but it's crashing when I download it from the app store. I'm going to keep working at the problem. Maybe I'm missing something else. @StacyMAI , if I may suggest an edit though. Your above post says to change 1.5 to 1.7:
But I had to change both to 1.8 because that's my version of Java (that's what that number is, correct?). Perhaps suggesting either one of those two may lead the next person to less confusion. |
@Zen-CODE Any news from that VM plan of yours? :o) |
@noembryon. There is not much to more to add to it at this point. It builds for API 27 with the "API 19, clear dists, build for 27" process. I'm working on fixing that but blocked by my python-for-android service dying on imports. That's also really import to get working for us, so I'm trying to sort that out before releasing a new VM... |
@Zen-CODE Yes, I understand. |
I created a solution that at the moment makes inclusion possible, it is extremely beta, but it already works for me. |
@atnccetti. Thanks. There are a few issues around python services and pyjnius that I want to resolve before redoing the VM. When I get there, I'll definitely look at this. Thanks :-) |
Should we close that one since #1412 was merged? |
Does that mean that there will be a new Virtual Image for us poor windows users? ;o) |
For my 2c, there are more issue around this than the python3 recipe. Python2? And until there is a buildozer.spec file that can build a python2/python3 APK from scratch, I think it best to keep it open.... |
Hi guys :) So here below the VM specs (full details in attachments):
As you can see from the r16b build log, i was able to make the APK (API 26, ARM64, Python3) but unfortunately my Oreo phone doesn't even let install the package (error during package analysis). |
@RezVIKONG. The build succeeds it seems, so the logs you've posted I don't really help us (as far as I can tell anyway). If deployment to the phone fails, we need to see why. That can (hopefully) be done by examining the output of
whilst your device is connected. The output of the logcat command should indicate why the deployment fails. Also, I would suggest continuing this discussion by posting on the kivy user group. This ticket is long and ready for closing, as support for API 26+ has been achieved. |
Any references to "support for API 26+ has been achieved", please? I am currently unable to build a webview bootstrap with python3 and flask, using target api 27. Thanks for all the work so far. |
@mistery p4a now properly supports different build versions in a way it didn't before, but only with the sdl2 bootstrap. The work @Jonast has been doing to unify the bootstraps has moved towards fixing this in the other ones as well (especially webview), but I don't think this particular issue is covered yet. There are a few other outstanding build target problems that I hope to look at together over Christmas.
You can just substitute 21 for 19 and it should work the same way. However, the webview bootstrap might have issues right now with the master branch so you may need to make sure your p4a is not quite up to date. |
@inclement, thanks a lot for the tips. I'm creating a Discord account for further discussion. I'm really hoping to get at least something going and would be looking to help as much as I can. |
@mistery For what it's worth, it shouldn't be very hard to make it work. |
Just wanted to put it on the devs’ radar. We’ve been limited to 19 for the last couple years, afaik, but kivy will need to support targeting 26 for new apps starting in August, and for app updates starting in November: https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html?m=1
If there’s currently a straightforward way to target 21 or higher then I’ll stand corrected and be very interested in hearing how.
The text was updated successfully, but these errors were encountered: