[英]My android app is getting device not supported when trying to download with tablet
[英]Android app not supported on any device?
我制作了一个运行良好的应用程序。 我不确定是什么原因导致我的应用在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);
}
那是我必须检查当前构建版本是什么的代码。 这有帮助吗?
我如何才能像以前一样将其用于所有设备?
对我来说,问题是清单文件中的这一行:
<uses-feature android:name="android.hardware.camera2" android:required="true" />
正确的方法是这样的-将required设置为false
<uses-feature android:name="android.hardware.camera2" android:required="false" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.