How to change the minSdkVersion of a project?

后端 未结 9 1036
夕颜
夕颜 2020-12-08 00:19

I have been building a project and testing it on the Android emulator.

I realized that I set the minSdkVersion to 10. Now, I have a phone to test the p

相关标签:
9条回答
  • 2020-12-08 00:27

    In your app/build.gradle file, you can set the minSdkVersion inside defaultConfig.

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.3"
    
        defaultConfig {
            applicationId "com.name.app"
            minSdkVersion 19    // This over here
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
    
    0 讨论(0)
  • 2020-12-08 00:36

    This is what worked for me:

    In the build.gradle file, setting the minSdkVersion under defaultConfig:

    Good Luck...

    0 讨论(0)
  • 2020-12-08 00:38

    Delete this line:

    <uses-sdk android:targetSdkVersion="..." />
    

    in the file:

    AndroidManifest.xml
    
    0 讨论(0)
  • 2020-12-08 00:40

    Set the min SDK version within your project's AndroidManifest.xml file:

    <uses-sdk android:minSdkVersion="4"/>
    

    What exactly causes the crash? Iron out all crashes/bugs in minimum version and then test in higher versions.

    0 讨论(0)
  • 2020-12-08 00:43

    Create a new AVD with the AVD Manager and set the Target to API Level 7. Try running your application with that AVD. Additionally, make sure that your min sdk in your Manifest file is at least set to 7.

    0 讨论(0)
  • 2020-12-08 00:45

    If you use a cordova to build your app, for me the best soluction is change the argument cdvMinSdkVersion=15 to cdvMinSdkVersion=19 in the file platforms\android\gradle.properties

    0 讨论(0)
提交回复
热议问题