appium: Encountered internal error running command: Error: targetSdkVersionFromManifest failed. Original error: Cannot read property '1' of null
when i run sample-code android_simple.py i got this error ,i search everywhere ,no result
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/jihongwen/Development/android/android-sdk-macosx/platform-tools/adb’ with args: [“-P”,5037,“-s”,“760ABLMW96TX”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[debug] [Logcat] Stopping logcat capture
[debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles
capability if wanted.
[MJSONWP] Encountered internal error running command: Error: targetSdkVersionFromManifest failed. Original error: Cannot read property ‘1’ of null
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (…/…/…/lib/tools/android-manifest.js:101:9)
at tryCatch (/Users/jihongwen/.nvm/versions/node/v7.2.0/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/jihongwen/.nvm/versions/node/v7.2.0/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/jihongwen/.nvm/versions/node/v7.2.0/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21)
at GeneratorFunctionPrototype.invoke (/Users/jihongwen/.nvm/versions/node/v7.2.0/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[HTTP] <-- POST /wd/hub/session 500 1585 ms
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 49 (15 by maintainers)
Workaround for now as below
Goto directory /usr/local/lib/node_modules/appium and run below command npm install appium-adb@2.7.0
After this npm -g ls , shows updated appium-adb@2.7.0 from appium-adb@2.9.0
Issue is fixed in appium-adb v2.9.1
Hi,
I’m also experiencing this issue on a mac 10.11.6, android nexus 5 api 23; appium 1.6.2. Tried appium-adb 2.7.0 and no changes
Hi, this workaround “npm install appium-adb@2.7.0” didn’t change a thing neither.
Upgrading to appium version 1.6.3 helped, Thanks.
npm install appium-adb@2.7.0 worked for me.
I am pretty new to node so I wasn’t installing it into the right place at first. Make sure you execute that command within the appium directory (for windows the default location for me is C:\Users\myusername\AppData\Roaming\npm\node_modules\appium" )
I am running appium@1.6.0 on windows 7, testing a Samsung S6 with the newest chrome app.
I also had to replace the “appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe” with the latest driver from here https://sites.google.com/a/chromium.org/chromedriver/ . This stopped the “NoSuchSession” error.
My tests are running great now.
@srkannan please upgrade appium version to 1.6.3 , thats got the fix
Got it! My fault. I did not install appium-adb correctly because we need to upgrade the appium-adb module that is inside the node_modules of the node_modules/appium folder. so just saying npm install appium-adb@2.9.1 is not sufficient. You have to do that from the node_modules\appium folder in order to upgrade the appium-adb that is where appium will find it. We are not all nodejs expert (at least I am not), but now it looks obvious to me.
Result is that it is working 😃
The error is displayed [ADB] Error: fetching targetSdkVersion from local APK failed. Original error: targetSdkVersion is not specified in the application. (with the full stack trace) [ADB] Ran into problem getting target SDK version; ignoring…
And all is working…
Thanks ! Just did that : workaround for 1.6.2 is reverting to 1.6.0 it works again 😃
@vincentlabatut, seems updating appium-adb to 2.9.1 was not successful. Can you please cross check(version in appium\node-modules\appium-adb\package.json).
Just to conform error message you have shared is related to 2.9.0, error message is changed in 2.9.1.
execute
npm install appium-adb@2.9.1
from appium repo.@vikramvi this issue has been picked by @sravanmedarapu and he is working on it …