发布我的应用程序后,我收到一条消息,说它与我的设备不兼容。 即使我在同一设备上对其进行了测试。 对于尝试下载该应用程序的每个人,都会显示“错误”消息,例如它与您的设备不兼容。 跟随摇篮:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.ths.dev.cadeoprefeito"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
//FirebaseCORE
implementation 'com.google.firebase:firebase-core:16.0.4'
//FirebaseDatabase
implementation 'com.google.firebase:firebase-database:16.0.3'
//ADSFirebase
implementation 'com.google.firebase:firebase-ads:16.0.1'
//FirebaseAUTH
implementation 'com.google.firebase:firebase-auth:16.0.4'
//FirebaseStorage
implementation 'com.google.firebase:firebase-storage:16.0.3'
//FirebaseUI
implementation 'com.firebaseui:firebase-ui-storage:0.6.0'
}
清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ths.dev.cadeoprefeito">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Permissões para foto -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera2" />
<uses-permission android:name="android.permission.READ_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">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".Activity.MapsActivity"
android:label="Cadê o Prefeito"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".Activity.SplashActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我不知道该怎么办。有帮助吗?
答案 0 :(得分:4)
您应在android:required="false"
部分中添加 android:name="android.hardware.camera2"
。
当您为某个功能声明
android:required="false"
时,表示 如果设备上存在应用程序,则该应用程序倾向于使用该功能, 但是它被设计为在没有指定功能的情况下运行,如果
<uses-feature android:name="android.hardware.camera2" android:required="false"/>
答案 1 :(得分:0)
不要以为android.hardware.camera2
是原因,这是当前设备上普遍可用的原因-当不需要它时,必须提供旧版camera
作为后备选项(带有地图和闪屏)屏幕上的活动,我想知道这样做有什么好处)。原因是:a)将supports-screens元素添加到Manifest.xml
...,因为没有它,就不支持单个屏幕尺寸。和b)在文件底部添加apply plugin: 'com.google.gms.google-services'
。