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

jar files can't package to the apk #709

Closed
zx013 opened this issue Aug 30, 2018 · 4 comments
Closed

jar files can't package to the apk #709

zx013 opened this issue Aug 30, 2018 · 4 comments

Comments

@zx013
Copy link

zx013 commented Aug 30, 2018

When I use lastest buildozer and lastest build-tools(28.0.2), it auto choose grade to pack. Then I set option android.add_jars in buildozer.spec, it seems not work well. The java class can not found in apk. So I check the code and add line in /root/.buildozer/android/platform/build/dists/zx013/templates/build.tmpl.gradle. And before run 'buildozer android release', I remove /root/.buildozer/android/platform/build/dists/zx013/build. After do this, the jar files can work well. So I think it maybe some mistake in it or I got the wrong way.

That is the build.tmpl.gradle I modify, compile fileTree(dir: 'src/main/libs', include: '.jar') is the line I have added.
dependencies {
compile fileTree(dir: 'src/main/libs', include: '
.jar')
{%- for aar in aars %}
compile(name: '{{ aar }}', ext: 'aar')
{%- endfor -%}
{%- if args.depends -%}
{%- for depend in args.depends %}
compile '{{ depend }}'
{%- endfor %}
{%- endif %}
}

@piropiro2018
Copy link

piropiro2018 commented Feb 7, 2019

I am suffering from similar problems.

Have you successfully built , android.add_jars by setting path?
Please allow me to disclose it. (The jar file name is like a stub character)

@zx013
Copy link
Author

zx013 commented Feb 7, 2019

Just modify /root/.buildozer/android/platform/build/dists/zx013/templates/build.tmpl.gradle, android.add_jars will take effect.

@OptimusGREEN
Copy link
Contributor

try this PR kivy/python-for-android#1693 to see if it fixes the issue.

@AndreMiras
Copy link
Member

Should be fixed with the PR linked above. Otherwise feel free to re-open with info

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

4 participants