Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the uiautomator version that will support Android SDK Level 16?

The UiAutomator v2.+ version supports only SDK level 18+ and according to documentation uiautomator shipped first with SDK Level 16. I need a way to include that version in my gradle file rather than v2.1.1. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'

like image 614
mehmetg Avatar asked Dec 13 '25 18:12

mehmetg


1 Answers

Add this specific AndroidManifest.xml into androidTest folder

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          package="your.package">

    <uses-sdk
        android:targetSdkVersion="22"
        android:minSdkVersion="16"
        tools:overrideLibrary="android.support.test.uiautomator.v18"/>

</manifest>

Trick here is done with:

tools:overrideLibrary marker

A special marker that can only be used with uses-sdk declaration to override importing a library which minimum SDK version is more recent than that application's minimum SDK version. Without such a marker, the manifest merger will fail. The marker will allow users to select which libraries can be imported ignoring the minimum SDK version.

like image 78
Renaud Mathieu Avatar answered Dec 16 '25 12:12

Renaud Mathieu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!