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

apksigner: no File.toPath() error #7132

Closed
canandlamp opened this issue Jul 12, 2021 · 14 comments
Closed

apksigner: no File.toPath() error #7132

canandlamp opened this issue Jul 12, 2021 · 14 comments

Comments

@canandlamp
Copy link

~/.../build/output $ apksigner sign --ks-type PKCS12 --ks /storage/emulated/0/canandlamp-release-key.keystore.new --in app-unsigned-debug.apk --out test-signed.apk
Keystore password for signer #1:
Exception in thread "main" java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:362)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:88)

Originally posted by @canandlamp in #5747 (comment)

@canandlamp canandlamp changed the title How now? How now -- continuing apksigner fail? Jul 12, 2021
@canandlamp canandlamp changed the title How now -- continuing apksigner fail? How now? -- continuing apksigner fail Jul 12, 2021
@canandlamp
Copy link
Author

canandlamp commented Jul 12, 2021

why are old versions not available in repository if the "improved" code is apt to such hangups?

@canandlamp canandlamp changed the title How now? -- continuing apksigner fail continuing apksigner fail Jul 12, 2021
@canandlamp canandlamp changed the title continuing apksigner fail apksigner: no File.toPath() error Jul 12, 2021
@Hax4us
Copy link
Contributor

Hax4us commented Jul 12, 2021

what's your android version ?

@canandlamp
Copy link
Author

7

@Hax4us
Copy link
Contributor

Hax4us commented Jul 12, 2021

yes then error makes sense now , as it will not work in Android < 8
toPath() was added in API level 26 ( Oreo ) https://developer.android.com/reference/java/io/File#toPath()

@canandlamp
Copy link
Author

is there a repository with previous versions? it used to work fine on this phone

@ghost
Copy link

ghost commented Jul 12, 2021

Why no old versions? Server disk space optimization. Our hosting capabilities are limited. We are not Debian.


Current apksigner is entirely different program than was before. We have switched from custom implementation (which is not developed anymore) to official one from SDK.

@ghost ghost closed this as completed Jul 12, 2021
@ghost ghost reopened this Jul 12, 2021
@ghost
Copy link

ghost commented Jul 12, 2021

We can provide apksigner-old package, at least until complete JDK will be packaged.

@ghost
Copy link

ghost commented Jul 12, 2021

apksigner-old has been added and will be available for installation shortly.

@ghost ghost closed this as completed Jul 12, 2021
@canandlamp
Copy link
Author

thanks. works great with the old style java keystore, but the new style wasn't recognized. sufficient for what's at hand here. thanks again

@Nemris
Copy link

Nemris commented Aug 1, 2021

@xeffyr I just noticed the new apksigner, but it seems the OpenJDK pulls in a ton of dependencies such as cups. Is there any way to skip those?

@ghost
Copy link

ghost commented Aug 1, 2021

You really don't have extra 11MB for cups? Most of space is taken by JDK which takes 300 MB when installed.

@Nemris
Copy link

Nemris commented Aug 1, 2021

I ended up upgrading - but still, I'm kind of curious about why cups would be needed.

@Grimler91
Copy link
Member

libcups is listed as a build dependency in archlinux, so maybe the dependency can be moved to TERMUX_PKG_BUILD_DEPENDS? (I have not tested the build yet)

@ghost
Copy link

ghost commented Aug 1, 2021

This is already done in latest rebuild (based on actual linking and built-in dlopen() calls. Interesting that libpng seems to be unused, but headers are needed):

TERMUX_PKG_DEPENDS="freetype, libandroid-shmem, libandroid-spawn, libiconv, zlib"
TERMUX_PKG_BUILD_DEPENDS="cups, fontconfig, libpng, libx11, libxrender"
TERMUX_PKG_SUGGESTS="cups, fontconfig, libx11, libxrender"

OpenJDK uses it internally for some functions even in headless build (PrintService API). So cups is still a dependency, even though indirect.

This issue was closed.
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