我做了一个工作正常的应用程序。我不确定是什么原因导致我的应用程序在Play商店发布后不支持任何设备。
这是我的gradle文件。
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "############"
minSdkVersion 15
targetSdkVersion 26
versionCode 12
versionName "12"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
我在其中一个课程中添加的唯一更改就是这个。
if (Build.VERSION_CODES.N <= android.os.Build.VERSION.SDK_INT) {
// FileProvider required for Android 7. Sending a file URI throws exception.
photoURI = FileProvider.getUriForFile(this,
BuildConfig.APPLICATION_ID + ".provider",
photoFile);
} else {
// For older devices:
// Samsung Galaxy Tab 7" 2 (Samsung GT-P3113 Android 4.2.2, API 17)
// Samsung S3
photoURI = Uri.fromFile(photoFile);
}
这是我检查当前构建版本的代码。这有帮助吗?
如何让它可以像以前一样回到所有设备?
答案 0 :(得分:0)
对我来说问题是清单文件中的这一行:
<uses-feature android:name="android.hardware.camera2" android:required="true" />
正确的方法就是这样 - 将required设置为false
<uses-feature android:name="android.hardware.camera2" android:required="false" />