Is it possible to set a different minSdkVersion
for tests than for the app itself? I ask because I want to use the new Test Support Library and UI Automator for testing. However, this is only available on API 18+. At the same time, I still want to support older versions of Android, albeit not as thoroughly tested. What do I need to add to my build.gradle
file in order to do this?
To clarify, I am using Android Studio and the "new" Gradle-based project structure.
You can see it here on their official build. gradle file: android { compileSdkVersion 28 ... defaultConfig { minSdkVersion(16) targetSdkVersion(28) versionCode(1) versionName("1.0") } ... } By setting minSdkVersion to 16 , react-native uses Android API's natively supported by at least KitKat version.
check it: Android Studio->file->project structure->app->flavors->min sdk version and if you want to run your application on your mobile you have to set min sdk version less than your device sdk(API) you can install any API levels. Show activity on this post. Set the min SDK version in your project's AndroidManifest.
To change Android minSdkVersion in Flutter for the project created after the 2.8 update, you have to make changes in the local. properties file and then reference the new variable from the local. properties file inside the build. gradle file.
I got this from the new testing template from Google.
Create a new AndroidManifest.xml
file in your test
or androidTest
folder.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:tools="http://schemas.android.com/tools" package="your.package.name"> <uses-sdk tools:overrideLibrary="android.support.test.uiautomator.v18"/> </manifest>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With