Clover currently requires us to use targetSdkVersion of 25 or lower. It would be nice if things were updated so that we do not have this restriction. But we need to work with what we have.
How do we get Android Studio setup to get an app to compile with targetSdkVersion 25? To keep things simple I tried creating a new project. I used the "Empty Activity" template, and set the minimum SDK level to 17. Then I modified the app/build.gradle file as follows
.... android { // compileSdkVersion 29 compileSdkVersion 25 // buildToolsVersion "29.0.2" buildToolsVersion "25.0.3" defaultConfig { applicationId "org.iroll.firebasetest4" minSdkVersion 17 // targetSdkVersion 29 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } ..... } ....
When I changed the targetSdkVersion to 25 I get a warning saying
Google Play requires that apps target API level 26 or higher.
Google Play is not on the Clover devices so I assume we can ignore this warning.
When I sync Gradle and build the project the build fails with a bunch of errors.
What else do we have to do to Android Studio to get a targetSdk 25 app that will compile so that it can be installed on Clover devices?
I Googled and searched the Clover forum but only found articles for upgrading version (something I do all the time on other apps), but almost nothing about downgrading versions. I figure that if I am running into a roadblock, there are probably other developers that will have the same issue.
Thanks,
Scott
EDIT:
Here is a full gradle file
apply plugin: 'com.android.application' android { compileSdkVersion 25 defaultConfig { applicationId "com.example.clovertest1" minSdkVersion 17 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' }
Here are the build errors
Executing tasks: [clean, :app:assembleDebug] in project C:\Users\scott\AndroidStudioProjects\CloverTest1 > Task :clean UP-TO-DATE > Task :app:clean > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:checkDebugManifest > Task :app:generateDebugBuildConfig > Task :app:javaPreCompileDebug > Task :app:compileDebugAidl NO-SOURCE > Task :app:compileDebugRenderscript NO-SOURCE > Task :app:mainApkListPersistenceDebug > Task :app:generateDebugResValues > Task :app:generateDebugResources > Task :app:createDebugCompatibleScreenManifests > Task :app:processDebugManifest > Task :app:mergeDebugResources > Task :app:processDebugResources FAILED AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml","position":{"startLine":4,"startColumn":4,"startOffset":217,"endLine":7,"endColumn":12,"endOffset":426}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml","position":{"startLine":8,"startColumn":4,"startOffset":431,"endLine":11,"endColumn":12,"endOffset":652}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml","position":{"startLine":12,"startColumn":4,"startOffset":657,"endLine":15,"endColumn":12,"endOffset":891}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v26\\values-v26.xml:13:5-16:13: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml","position":{"startLine":4,"startColumn":4,"startOffset":217,"endLine":7,"endColumn":12,"endOffset":442}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml","position":{"startLine":8,"startColumn":4,"startOffset":447,"endLine":11,"endColumn":12,"endOffset":684}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values-v28\\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml","position":{"startLine":141,"startColumn":4,"startOffset":8780,"endLine":172,"endColumn":24,"endOffset":10840}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\e9dab9c67c1ee3668e0bbf86c6d8cbd8\\core-1.1.0\\res\\values\\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.\n ","tool":"AAPT"} AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values\\values.xml","position":{"startLine":2771,"startColumn":4,"startOffset":173278,"endLine":2794,"endColumn":24,"endOffset":174475}}],"original":"C:\\Users\\scott\\.gradle\\caches\\transforms-2\\files-2.1\\6119d746697059b7e1b74aab4d181f56\\appcompat-1.1.0\\res\\values\\values.xml:2772:5-2795:25: AAPT: error: resource android:attr/textFontWeight not found.\n ","tool":"AAPT"} FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values-v26\values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values-v28\values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found. C:\Users\scott\.gradle\caches\transforms-2\files-2.1\6119d746697059b7e1b74aab4d181f56\appcompat-1.1.0\res\values\values.xml:2772:5-2795:25: AAPT: error: resource android:attr/textFontWeight not found. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2s 11 actionable tasks: 10 executed, 1 up-to-date