appium 初始化安裝的時候報錯 Error getting strings.xml from apk

xst發表於2020-05-15

appium log

info: Client User-Agent string: appium/python 0.52 (selenium/3.141.0 (python windows))

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
info: [debug] Using local app from desired caps: C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk
info: [debug] Creating new appium session 225dad31-d728-4a7b-bb41-6242346a57fe
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 11.0.4
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\android-sdk-windows\platform-tools\adb.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device 46c4bd8
info: [debug] Setting device id to 46c4bd8
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe -s 46c4bd8 wait-for-device
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe -s 46c4bd8 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe -s 46c4bd8 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 23
info: Device API level is: 23
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe -s 46c4bd8 shell "getprop persist.sys.language"
info: [debug] Current device persist.sys.language:
info: [debug] java -jar "C:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk" "C:\WINDOWS\TEMP\com.xinrenlei.koubeigongzuo"
info: [debug] No strings.xml for language '', getting default strings.xml
info: [debug] java -jar "C:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk" "C:\WINDOWS\TEMP\com.xinrenlei.koubeigongzuo"
warn: Error getting strings.xml from apk
info: [debug] WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.appium.apktools.StringsXML (file:/C:/Appium/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar) to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of io.appium.apktools.StringsXML
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f110046 style/Base.Theme.AppCompat.Dialog, config=-v21
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:186)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:157)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:125)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:605)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at io.appium.apktools.StringsXML.run(StringsXML.java:84)
at io.appium.apktools.Main.main(Main.java:31)
Cleaning up unclosed ZipFile for archive C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk

warn: Could not get strings, continuing anyway
info: [debug] executing cmd: C:\android-sdk-windows\platform-tools\adb.exe -s 46c4bd8 shell "echo '{}' > /data/local/tmp/strings.json"
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\android-sdk-windows\build-tools\28.0.3\aapt.exe
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: C:\android-sdk-windows\build-tools\28.0.3\aapt.exe dump xmltree C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk AndroidManifest.xml
info: [debug] Set app process to: com.xinrenlei.koubeigongzuo
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk.
info: [debug] executing cmd: java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk
info: [debug] App not signed with debug cert.
info: [debug] Resigning apk.
info: [debug] executing cmd: java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override"
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at s.Sign.addDigestsToManifest(Sign.java:108)
at s.Sign.sign(Sign.java:454)
at s.Sign.main(Sign.java:532)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 3 more

info: [debug] Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override"
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at s.Sign.addDigestsToManifest(Sign.java:108)
at s.Sign.sign(Sign.java:454)
at s.Sign.main(Sign.java:532)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 3 more

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override\"\nException in thread \"main\" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder\r\n\tat s.Sign.addDigestsToManifest(Sign.java:108)\r\n\tat s.Sign.sign(Sign.java:454)\r\n\tat s.Sign.main(Sign.java:532)\r\nCaused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder\r\n\tat java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)\r\n\tat java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)\r\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)\r\n\t... 3 more\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\WINDOWS\system32\cmd.exe /s /c \"java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override\"","origValue":"Command failed: C:\WINDOWS\system32\cmd.exe /s /c \"java -jar C:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\appresource\onsite-user-Vmaster-Release-200508-1625.apk --override\"\nException in thread \"main\" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder\r\n\tat s.Sign.addDigestsToManifest(Sign.java:108)\r\n\tat s.Sign.sign(Sign.java:454)\r\n\tat s.Sign.main(Sign.java:532)\r\nCaused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder\r\n\tat java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)\r\n\tat java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)\r\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)\r\n\t... 3 more\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 11811.088 ms - 1920

相關文章