Skip to content
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

Error: minsdk argument does not match the api that is compiled against #768

Closed
Petar-Luketina opened this issue Dec 14, 2018 · 9 comments
Closed

Comments

@Petar-Luketina
Copy link

I got this error while building a Python 2.7 android app:

WARNING: --minsdk argument does not match the api that is compiled against.
Only proceed if you know what you are doing, otherwise use --minsdk=21 or
recompile against api 19
You must pass --allow-minsdk-ndkapi-mismatch to build with --minsdk different to
the target NDK api from the build step

Does anyone have any insight into this error? Is minsdk new, because I never included it in my previous apps. Thank you in advance!

Buildozer spec:

# (int) Android API to use
android.api = 27
# (int) Minimum API required
android.minapi = 19
# (int) Android SDK version to use
android.sdk = 23
# (str) Android NDK version to use
android.ndk = 16b
@AndreMiras
Copy link
Member

Yes things have changed recently in p4a.
Can you try android.minapi = 21 as suggested in your spec and see if it works?

@Petar-Luketina
Copy link
Author

Hey @AndreMiras , I get this error when I do that:

IOError: [Errno 2] No such file or directory: u'/home/pl/Desktop/blind/.buildozer/android/platform/build/dists/blindgames1/build/outputs/apk/blindgames1-debug.apk'

Any ideas?

@AndreMiras
Copy link
Member

AndreMiras commented Dec 16, 2018

Yes I think these path have moved recently, see kivy/python-for-android#1507
Try: find .buildozer/ -name "*.apk"

@Petar-Luketina
Copy link
Author

hmm... So the apk is complete, but in the wrong place?

@AndreMiras
Copy link
Member

That's more or less the idea. Well try to delete your .buildozer/ directory and build again, also make sure you run on p4a.branch = master.
If it still fails, share the output of the find command above.

@Petar-Luketina
Copy link
Author

Petar-Luketina commented Dec 16, 2018

I followed the steps, and I still go the same error. My apk is here:
.buildozer/android/platform/build/dists/blindgames1/build/outputs/apk/debug/blindgames1-debug.apk

What's this in the #1507 issue? sudo p4aspaces cmd p4a-py2-api19-ndkbundle testbuild --p4a https://github.com/opacam/python-for-android/archive/fix-ci-gradle.zip

Are you supposed to run this code to download his spec to test it? Apparently his works without a problem.

@AndreMiras
Copy link
Member

In kivy/python-for-android#1507 we added the mode (e.g. debug/release) to the directory to pick the apk from.
https://github.com/kivy/python-for-android/pull/1507/files#diff-9386f079c34547ba8b06a93309463a72R852
I'm not too sure why it might not work with your build. But as a temporary workaround you could revert only the pythonforandroid/toolchain.py file and remove the args.build_mode.

@ghost
Copy link

ghost commented Dec 23, 2018

@AndreMiras for the last person having this issue of the .apk being in the wrong place, using p4a clean_all fixed it. Basically, building once with an older p4a version, then using a newer p4a version on the existing distribution (without wiping the distribution folder) will trigger this error. Not sure adding a "fix" into the p4a codebase is worth the time, since the best thing to do is just a quick p4a clean_all and just repeating the build

@inclement
Copy link
Member

Closing as apparently resolved.

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

No branches or pull requests

3 participants