我在Android上创建了应用程序,主要目标是:用户使用他的Google帐户进行日志记录,扫描NFC标签,使用排球库将用户登录信息和标签发送到服务器并获得回应。
一切工作正常,当时,我正在使用Android工作室和USB调试,一切都很好。我已将该应用放到Google Play商店,并且与我的p9 lite或任何其他带NFC的手机不兼容。所以我甚至无法下载应用程序。
这是谷歌截图玩:Android应用程序与我的设备不兼容
这里是我的Android清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="some.package.name">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-feature android:name="android.nfc"/>
<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"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</application>
</manifest>
这里也是我的gradle这个建设项目:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
而且gradle这个构建的应用程序:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'key0'
storeFile file('C:/AndroidKey/RandomKey.jks')
keyPassword 'randomKey'
storePassword 'randomPassword'
}
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "someId"
minSdkVersion 15
targetSdkVersion 25
versionCode 3
versionName "1.02"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
}
dependencies {
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
compile 'com.android.volley:volley:1.0.0'
compile 'com.yarolegovich:lovely-dialog:1.0.5'
compile 'hanks.xyz:htextview-library:0.1.5'
compile fileTree(include: ['*.jar'], dir: 'libs')
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.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:9.8.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
一切正常通过USB良好连接,但我甚至无法从Google Play商店下载应用程序。
在这种情况下我能做些什么?感谢和问候。
编辑: 我已经改变<uses-feature android:name="android.nfc"/>
到<uses-feature android:name="android.hardware.nfc"/>
但还是同样的情况:
编辑:我的设备具有NFC,当我点击的选项,以显示兼容设备对于我的应用程序它在那里。
因为你的设备没有nfc。 ' ' –
shmakova