budtmo / budtmo/docker-android
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
- Dominant language
- Python
- Stars
- 15.8k
- Forks
- 1.8k
- Avg merge
- 12h 13m
- Merged PRs (30d)
- 6
Description
## 🐛 Bug Report
Operating System:
**Ubuntu 20.04**
Docker Image:
- budtmo/docker-android-x86-5.1.1
Docker Version:
**19.03.12**
Docker-compose version (Only if you use it):
**1.25.5**
Docker Command to start docker-android:
`docker-compose up -d`
## Expected Behavior
A working demo test
## Actual Behavior
```
user@localhost: ~/docker-android/example/android/python$ pip3 install -r requirements.txt
user@localhost: ~/docker-android/example/android/python$ python3 app_simple.py
test_calculation (__main__.SimpleAndroidUITests) ... ERROR
======================================================================
ERROR: test_calculation (__main__.SimpleAndroidUITests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "app_simple.py", line 20, in setUp
self.driver = webdriver.Remote('http://127.0.0.1:4444/wd/hub', desired_caps)
File "/home/user/.local/lib/python3.8/site-packages/appium/webdriver/webdriver.py", line 36, in __init__
super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/home/user/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/home/user/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/user/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/user/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Performing Push Install
/root/tmp/tested-app.apk: 1 file pushed, 0 skipped. 5.3 MB/s (6419485 bytes in 1.160s)
pkg: /data/local/tmp/tested-app.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
----------------------------------------------------------------------
Ran 1 test in 9.764s
FAILED (errors=1)
```
## Tried solutions
### Manual install with the interactive shell
```
root@6a085789e139:~/tmp# adb -s emulator-5554 push tested-app.apk /data/tmp/tested.apk
tested-app.apk: 1 file pushed, 0 skipped. 233.4 MB/s (6419485 bytes in 0.026s)
root@6a085789e139:~/tmp# adb -s emulator-5554 shell pm install -r /data/tmp/tested.apk
pkg: /data/tmp/tested.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
```
### Reset containers
### Reboot PC & Docker daemon
### Trying to verify certificate
```
root@7f00a624f904:~/build-tools/30.0.1# ./apksigner verify /root/tmp/tested-app.apk
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
root@7f00a624f904:~/build-tools/30.0.1#
```
However, this may not be the issue :
> Also, for info, Java8 works for me with build-tools 30
> It might be that a fallback (`sign.jar`) is used in such case. Like I said, look at the method above to understand the flow better.
_Originally posted by @mykola-mokhnach in https://github.com/appium/appium/issues/14567#issuecomment-660119750_
### Set the `remoteAppsCacheLimit` appium capability to zero
Link of the process used by appium to verify apk : https://github.com/appium/appium-adb/blob/07ddb4bc1a31955c15d0bab6a726dbd5a29d5af5/lib/tools/apk-signing.js#L143
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.