一个非常基本的Android应用程序在很多设备上不兼容

问题描述:

因此,我有一个应用程序具有一些非常基本的功能,包括写入外部下载文件夹,将文件保存到外部缓存以及打开电子邮件应用程序的Intent。然而我的应用只能在372设备上兼容。我想知道我在做什么导致我的应用程序不兼容?一个非常基本的Android应用程序在很多设备上不兼容

我的AndroidManifest.xml文件:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.mycompany.myapp"> 
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:roundIcon="@mipmap/ic_launcher_round" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
     <activity android:name=".MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name=".ResultsActivity"></activity> 
    </application> 
</manifest> 

我的build.gradle文件:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "com.mycompany.myapp" 
     minSdkVersion 24 
     targetSdkVersion 25 
     versionCode 2 
     versionName "1.0.1" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     jackOptions { 
      enabled true 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_8 
     targetCompatibility JavaVersion.VERSION_1_8 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:support-v4:25.3.1' 
    testCompile 'junit:junit:4.12' 
} 

minSdkVersion是24.根据设备支持API级别的google只有约7%或24更大。考虑减少它和测试你的应用程序在这些API级别

+0

谢谢。 minSdkVersion降至19,现在可兼容超过7,000台设备。 – 1pieceofbleach