我读过关于这个主题的每篇文章,但我仍然无法解决我的问题。当我将我的应用程序上传到Play商店时,它表示有0个支持的设备。在这一点上,我不知道问题可能是什么......这就是我试过的:
我的manifest
看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="..." >
<!-- Required permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required features -->
<uses-feature android:name="android.hardware.camera"
android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature android:name="android.hardware.camera.flash"
android:required="false" />
<uses-feature android:name="android.hardware.camera.front"
android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait"
android:required="true" />
<uses-feature android:name="android.hardware.touchscreen"
android:required="true" />
<application
android:name="..."
android:allowBackup="false"
android:icon="@drawable/app_ic"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<activity
android:name="..."
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="..."
android:clearTaskOnLaunch="true"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:stateNotNeeded="true"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="..."
android:launchMode="singleTop"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
我的build.gradle
看起来像这样:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.1'
defaultConfig {
applicationId "..."
minSdkVersion 9
targetSdkVersion 21
versionCode 10
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile files('libs/core-1.51.0.0.jar')
compile files('libs/prov-1.51.0.0.jar')
compile files('libs/core.jar')
}
更新
Developer Console中的原生平台声明为:junit-4.11.jar,junit-LICENSE.html。这是正常的吗?
答案 0 :(得分:1)
过去我见过这个问题,请尝试删除......
<uses-feature android:name="android.hardware.screen.portrait"
android:required="true" />