-
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
p4a Doesn't Pick Up Latest Installed Java Command Line Tools, Resulting in avdmanager exception #2540
Comments
This is the new minimum the google play store requires. note: the newer android command-line tools use a tiny bit different paths, hence the `mv "${ANDROID_SDK_HOME}/cmdline-tools" "${ANDROID_SDK_HOME}/tools"` rename see kivy/python-for-android#2540
Yeah, recently In |
I have this same problem, I've followed instructions at: https://stackoverflow.com/a/67413427 Then when building I get:
I don't know about you, but to me this sounds very acute, because I don't understand any way around. |
I can proceed by editing /usr/lib/python3.10/site-packages/pythonforandroid/build.py lines 116 and 117 to:
But now the error becomes:
|
As a workaround, until we update macOS: https://dl.google.com/android/repository/commandlinetools-mac-6514223_latest.zip |
I can also proceed from the previous edit of /usr/lib/python3.10/site-packages/pythonforandroid/build.py lines 116 and 117 to:
Then the error becomes:
|
Did you installed the requested API? |
Yes, but by using /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager as given in: my ~/.bashrc:
The installation created a new /tools/ for example, but:
At line 358 of /usr/lib/python3.10/site-packages/pythonforandroid/build.py we find:
The self.sdk_dir prints to /opt/android-sdk, which indeed should be the sdk_root. |
The reason it doesn't return any available APIs is caused by:
at line 131 resulting to apis = []. Even when the line before it
has the full output of /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager --list. This list actually does contain:
|
I can proceed by commenting out the lines that check for the API (358-367):
Now the error becomes:
|
I can proceed by modifying line 430 to use the python3 that I really use:
Now error becomes:
|
Finally, changing to android-ndk-r19c, rather than android-ndk-r23b, the build starts and goes on for quite a long time until I hit something which looks like a python3 name mismatch again:
|
Modifying line 1118 of recipe.py to:
ends up to:
Which may suggest that altering "python3" is not robust. Also: |
In #2593 I changed p4a to prefer the newer |
Recent Android SDK tools, including e.g. "8092744" and "8512546" [0][1], use a different path structure. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy/python-for-android#2540 kivy/python-for-android#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy/python-for-android#2540 kivy/python-for-android#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Just coming back of a fdroidata merge. And agiain trapped into the The only call to avdmanager is in build.py/get_targets() as get_targets() is called only from get_available_apis(). The only Targets api information in android-sdk resides in the subdir 'platforms'
This would deliver the same information and eliminate a critical dependency. |
Addendum (correctly formatted now):
|
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy#2540 kivy#2593
Recent Android SDK tools, including e.g. "8092744" and "8512546" [1][2], use a different path structure than e.g. "6514223" [0]. E.g. `sdkmanager` in older sdk tools used to be located at ${ANDROID_SDK_HOME}/tools/bin/sdkmanager but now it is at ${ANDROID_SDK_HOME}/cmdline-tools/bin/sdkmanager [0]: https://dl.google.com/android/repository/commandlinetools-linux-6514223_latest.zip [1]: https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip [2]: https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip Related: kivy/python-for-android#2540 kivy/python-for-android#2593
Versions
Description
I'm trying to build an apk with p4a for the first time. Using IntellijIdea, I installed the latest sdk command line tools. But p4a used the avdmanager in ../Sdk/tools/bin, instead of the new one which was installed in the default location .../Sdk/cmdline-tools/latest/bin. The avdmanager then threw a ClassNotFoundException for javax.xml.bind.annotation.XmlSchema.
Logs
The text was updated successfully, but these errors were encountered: