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

Kivy Buildozer Error #1712

Closed
Ridola20 opened this issue Oct 1, 2023 · 14 comments
Closed

Kivy Buildozer Error #1712

Ridola20 opened this issue Oct 1, 2023 · 14 comments
Labels

Comments

@Ridola20
Copy link

Ridola20 commented Oct 1, 2023

STDERR:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
... 5 more

@RobertFlatt
Copy link
Contributor

Check that the Java version meets the specification in the Buildozer install instructions.

In future please use the user groups for usage questions.

@Ridola20
Copy link
Author

Ridola20 commented Oct 2, 2023

I

Check that the Java version meets the specification in the Buildozer install instructions.

In future please use the user groups for usage questions.

I have checked my java and changed it to 1.8.0, it worked but i am also having problems with my gradlew.

It seems like my gradlew requires open jdk11 to clean assemble debug....... If i try to switch to java 11, Buildozer will give the error at the top of this page................... I don't know what to do, pls help??

@Ridola20
Copy link
Author

Ridola20 commented Oct 2, 2023

The error now is ~

cd /mnt/c/Users/user/desktop/project/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp && /mnt/c/Users/user/desktop/project/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/gradlew clean assembleDebug

[WARNING]: ERROR: /mnt/c/Users/user/desktop/project/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/myapp/gradlew failed!
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch

Command failed: ['/mnt/c/Users/user/desktop/project/venv/bin/python3', '-m', 'pythonforandroid.toolchain', 'apk', '--bootstrap', 'sdl2', '--dist_name', 'myapp', '--name', 'My Application', '--version', '0.1', '--package', 'org.test.myapp', '--minsdk', '21', '--ndk-api', '21', '--private', '/mnt/c/Users/user/desktop/project/.buildozer/android/app', '--android-entrypoint', 'org.kivy.android.PythonActivity', '--android-apptheme', '@android:style/Theme.NoTitleBar', '--orientation', 'portrait', '--window', '--enable-androidx', '--copy-libs', '--arch', 'arm64-v8a', '--arch', 'armeabi-v7a', '--color=always', '--storage-dir=/mnt/c/Users/user/desktop/project/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a', '--ndk-api=21', '--ignore-setup-py', '--debug']

@RobertFlatt
Copy link
Contributor

I have checked my java and changed it to 1.8.0,

See the Buildozer install instructions for the correct Java version.

I expect getting the Java version right will address the Gradle issue.

When you get it right to be on the safe side, do this too https://github.com/Android-for-Python/Android-for-Python-Users#changing-buildozerspec

And FYI if instructions for finding Gradle's actual first message https://github.com/Android-for-Python/Android-for-Python-Users#gradlew-failed

@Ridola20
Copy link
Author

Ridola20 commented Oct 2, 2023

Android on Ubuntu 20.04 and 22.04 (64bit)

(expected to work as well in later version, but only regularly tested in the latest LTS)

sudo apt update
sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
pip3 install --user --upgrade Cython==0.29.33 virtualenv # the --user should be removed if you do this in a venv

add the following line at the end of your ~/.bashrc file

export PATH=$PATH:~/.local/bin/

If openjdk-17 is not compatible with other installed programs, for Buildozer the minimum compatible openjdk version is 11.

@Ridola20
Copy link
Author

Ridola20 commented Oct 2, 2023

On the site, it says either 17 or 11, but i tried both and still does not work for me

At least, between..??

@Ridola20
Copy link
Author

Ridola20 commented Oct 2, 2023

Check configuration tokens

Buildozer is running as root!
This is not recommended, and may lead to problems later.
Are you sure you want to continue [y/n]? y

Ensure build layout

Check configuration tokens

Preparing build

Check requirements for android

Search for Git (git)

-> found at /usr/bin/git

Search for Cython (cython)

-> found at /mnt/c/Users/user/desktop/project/venv/bin/cython

Search for Java compiler (javac)

-> found at /usr/lib/jvm/java-17-openjdk-amd64/bin/javac

Search for Java keytool (keytool)

-> found at /usr/lib/jvm/java-17-openjdk-amd64/bin/keytool

Install platform

Run ['git', 'clone', '-b', 'master', '--single-branch', 'https://github.com/kivy/python-for-android.git', 'python-for-android']

Cwd /mnt/c/Users/user/desktop/project/.buildozer/android/platform

Cloning into 'python-for-android'...
Updating files: 100% (583/583), done.

Run ['/mnt/c/Users/user/desktop/project/venv/bin/python3', '-m', 'pip', 'install', '-q', 'appdirs', 'colorama>=0.3.3', 'jinja2', 'sh>=1.10, <2.0; sys_platform!="win32"', 'build', 'toml', 'packaging']

Cwd None

Apache ANT found at /root/.buildozer/android/platform/apache-ant-1.9.4

Android SDK found at /root/.buildozer/android/platform/android-sdk

Recommended android's NDK version by p4a is: 25b

Android NDK found at /root/.buildozer/android/platform/android-ndk-r25b

Installing/updating SDK platform tools if necessary

Run ['/root/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager', '--sdk_root=/root/.buildozer/android/platform/android-sdk', 'platform-tools']

Cwd /root/.buildozer/android/platform/android-sdk

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 5 more

Command failed: ['/root/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager', '--sdk_root=/root/.buildozer/android/platform/android-sdk', 'platform-tools']

i get this with version 17 and 11.....But it seeems to work perfectly with 8 except that gradlew get the error : -> #1712 (comment)

@RobertFlatt
Copy link
Contributor

Follow the install instructions, always.

Some possibilities to explore (and 2-4 will definitely cause other issues later):

  1. Something is corrupted from the previous attempt, delete ~/.buildozer
  2. Buildozer is running as root, this is known to cause issues on Linuxes with user accounts, you ignored the warning.
  3. The app in on the Windows partition, the install instructions explicitly say don't do this.
  4. The app is in a venv on the Windows partition, is this a Linux Python or Windows Python venv ?

@Ridola20
Copy link
Author

Ridola20 commented Oct 3, 2023

Thank You Very Much

I have changed to 17 and went further to meet another error

Warning: An error occurred while preparing SDK package Android SDK Build-Tools 34: Remote host terminated the handshake.

@RobertFlatt
Copy link
Contributor

Looks like a network error.
I have not seen this before.

@misl6
Copy link
Member

misl6 commented Oct 4, 2023

Yeah, that definitely looks like a network error. Can you try to clean your .buildozer folder and try again?

@Ridola20
Copy link
Author

Ridola20 commented Oct 5, 2023

Thank you very much
I buildozer appclean
and started the whole buildozer android debug process from start

Getting other bugs/errors but they are things i can handle for now, i'll update you on other error that shows up later

@misl6
Copy link
Member

misl6 commented Oct 5, 2023

Feel free to re-open another issue, if something else shows up.
But please, consider using our Discord if you're unsure if is a bug or a "support request".

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

👋 @Ridola20, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.

@github-actions github-actions bot closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants