2

I have a library in my Android Studio project, RevealLayout, which I use to get an expanding animation from a FAB as explained in this post.

The library works, however the problem I am running into is that whenever I change anything in Gradle, such as adding repository, and it rebuilds, the file AndroidManifest.xml under `libs\FabReveal\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1is regenerated, causing theandroid:minSdkVersion` to be set to 7.

This causes an error in the build until I change the value and rebuild. Which sticks until the next time I change Gradle or reopen Android Studio.

What do I need to do to change this value permanently?

Community
  • 1
  • 1
Theo Pearson-Bray
  • 775
  • 1
  • 13
  • 32

2 Answers2

1

You are doing somenthing wrong.

You can't change the minSdk of your dependencies modifying the value inside the intermediates\exploded-aar folder. Building and cleaning the project this folder is recreated by gradle, then you will change any change.

In your project you can't use a minSdk level lower than the level used by one of your dependencies.
It means that if you are using the appcompat library which has a minSdk=7 you can't use a level <7 but of course you can use a higher level.

To do it change your build.gradle file

   defaultConfig {
        minSdkVersion XX  // >=7 
    }
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

Change it in your app module's build.gradle. Here's a section of one of mine:

android {
    defaultConfig {
        applicationId 'com.mycompany.myapp'
        minSdkVersion 14 // change this value
        //noinspection OldTargetApi - until I have an Android 6+ device to test on
        targetSdkVersion 21
        versionCode 200
        versionName "2.0"
    }
}
Kevin Krumwiede
  • 9,868
  • 4
  • 34
  • 82