native-run: ERR_SDK_PACKAGE_NOT_FOUND executing ionic cordova run android
Version:
0.2.6
Description:
Running the command ionic cordova run android
I get the error ERR_SDK_PACKAGE_NOT_FOUND
Command Output:
2019-06-22T15:11:54.995Z native-run:android:utils:sdk:getSDKPackage Encountered error with C:\Program Files (x86)\Android\android-sdk\platform-tools\package.xml: { [Error: ENOENT: no such file or directory, open ‘C:\Program Files (x86)\Android\android-sdk\platform-tools\package.xml’] errno: -4058, code: ‘ENOENT’, syscall: ‘open’, path: ‘C:\Program Files (x86)\Android\android-sdk\platform-tools\package.xml’ } ERR_SDK_PACKAGE_NOT_FOUND: SDK package not found by location: C:\Program Files (x86)\Android\android-sdk\platform-tools. 2019-06-22T15:11:54.996Z native-run Caught fatal error: { Error: SDK package not found by location: C:\Program Files (x86)\Android\android-sdk\platform-tools. at Object.getSDKPackage (C:\Users\Alessandro\AppData\Roaming\npm\node_modules\native-run\dist\android\utils\sdk\index.js:90:23) code: ‘ERR_SDK_PACKAGE_NOT_FOUND’, exitCode: 1, data: undefined } [ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
SDK Info:
SDK Location: C:\Program Files (x86)\Android\android-sdk AVD Home: C:\Users\Alessandro.android\avd
Tools:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (6 by maintainers)
I had the same issue and resolved it by running the following command:
sdkmanager --list
sdkmanager.bat is a batch file that was in
C:\Program Files (x86)\Android\android-sdk\tools\bin\
but it might be in another location on your computer. Go to that folder within the command prompt and run thesdkmanager --list
command.After I ran that command, the package.xml file appeared in the directory and resolved the ERR_SDK_PACKAGE_NOT_FOUND error.