2017-04-10 66 views
0

我在Android上创建了应用程序,主要目标是:用户使用他的Google帐户进行日志记录,扫描NFC标签,使用排球库将用户登录信息和标签发送到服务器并获得回应。
一切工作正常,当时,我正在使用Android工作室和USB调试,一切都很好。我已将该应用放到Google Play商店,并且与我的p9 lite或任何其他带NFC的手机不兼容。所以我甚至无法下载应用程序。

这是谷歌截图玩:enter image description hereAndroid应用程序与我的设备不兼容

这里是我的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"/>

但还是同样的情况:
enter image description here

编辑:我的设备具有NFC,当我点击的选项,以显示兼容设备对于我的应用程序它在那里。 enter image description here

+1

因为你的设备没有nfc。 '' – shmakova

回答

0

好了,所以我找到了解决办法,谢谢大家的提示,答案是没有在清单中,混乱的问题,很抱歉。
Private apps in company

我不是谷歌的管理员Play开发者控制台,而主人没有检查权

允许用户更新谷歌Play私人

所以当开发一个公司应用这个选项是必要的。 感谢您的帮助和问候。

编辑:此外,该设备必须有一个工作配置文件来安装应用程序,它现在工作。

1

正确的标签是

<uses-feature android:name="android.hardware.nfc"/> 

如果您的应用程序也适用于不具备NFC芯片的设备,你应该添加android:required="false"上面的标签。

1

如果你的应用程序有没有NFC模块的设备工作,你应该改变你的uses-feature这样的:

<uses-feature android:name="android.hardware.nfc" android:required="false" /> 

如果您的应用程序不无NFC模块的设备正常工作,你应该有兼容设备与NFC和改变你的uses-feature这样的:

<uses-feature android:name="android.hardware.nfc" /> 
相关问题