When tests fail with this error, the response to the POST session command should give us a clue on the issue. You can find this under the Commands tab in the Sauce Labs test.
Make sure that the app meets the requirements listed here.
Some things to look into and errors you might encounter:
1. The apk was correctly uploaded to Sauce Storage (if using Sauce Storage)
You can use the Get Store Files REST API command to check the files in Sauce Storage.
curl -u <SAUCE_USERNAME>:<SAUCE_ACCESS_KEY> https://saucelabs.com/rest/v1/storage/<SAUCE_USERNAME>
The size of the file returned here is in bytes and if it is a few bytes that indicates there was an issue with the apk upload. You might be missing the @ before the file path. Without that '@' character, all that will be uploaded as your app is a string representing the file path, not the actual file itself.
Detailed information on uploading the app is available in our Wiki here:
Error you might see in this case: dump failed because no AndroidManifest.xml found
2. Error starting the application
{ "message": "An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.swaglabsmobileapp' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.swaglabsmobileapp.SplashActivity' or 'com.swaglabsmobileapp.com.swaglabsmobileapp.SplashActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting" }
or
“Could not get focusPackageAndActivity”
- Appium retrieves the package and activity names from the Apk manifest but looks like there are issues here. Confirm that the correct activity is being started when the app is launched.
Try adding the appPackage and appActivity capabilities.
If you are still seeing issues and you have a splash screen or something between startup and the main activity, set that to appWaitActivity.
- Check the Appium version you are using. If you haven’t explicitly added the capability, the default version (which could be old) will be used.
The first line of the appium-server.log (under Logs tab) states the version of Appium being used in the test.
You could use the Platform Configurator to find the latest Appium version available for the platform version you are using. Specify this as the value for the appiumVersion capability.
- The issue here could also be that you are using the old UiAutomator driver.
Newer versions of Appium will automatically use UiAutomator2.
You could explicitly specify it using the automationName capability.
3. INSTALL_FAILED_NO_MATCHING_ABIS
This error implies that the application was built for a different architecture than the emulator it's being run on.
We support x86 or x86_64 on our Android Emulators. Android 8.1 is our x86 Emulator and all other versions are x86_64.
Note: Apps with ARM architectures will work on our Real Devices.
4. INSTALL_FAILED_TEST_ONLY
The issue here is that the application was built with the android:testOnly attribute
The solution here is to edit the AndroidManifest.xml and remove the attribute or set it to false
5. INSTALL_FAILED_INSUFFICIENT_STORAGE
Here is a KB Article with information on this error.