我们是TourisMap的开发者。我们不明白为什么在Google Play开发者控制台上传我们的apk后,我们支持0个设备。我们个人的想法是Manifest和build.gradle都可以:我们可以生成apk,而不是我们可以毫无问题地将它分发给我们的Beta测试人员。你能帮助我们吗?在您看来,我们的错误在哪里?
AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.caronteconsulting.tourismap"
android:versionName="@string/version">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true"></supports-screens>
<uses-sdk android:minSdkVersion="13" android:targetSdkVersion="13" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="asd"/>
<activity
android:configChanges="orientation|keyboardHidden|screenSize"
android:name=".MainActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".SplashActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.caronteconsulting.tourismap"
minSdkVersion 13
targetSdkVersion 13
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig getSigningConfig()
applicationVariants.all { variant ->
variant.outputs.each { output ->
def date = new Date();
def formattedDate = date.format('yyyyMMddHHmmss')
def newName = output.outputFile.name
newName = newName.replace("app-", "TourisMap-")
newName = newName.replace("-release", "-release" + formattedDate)
output.outputFile = new File(output.outputFile.parent, newName)
}
}
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
}
答案 0 :(得分:1)
将targetSdkVersion
设置为23。
答案 1 :(得分:1)
我们发现了这个问题。感谢指示here,我们发现在 build.gradle 中生成0个设备的行:
dependencies {
[...]
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
}
我们使用该lib来获取UTF-8中的字符串。我们删除org.apache.commons.io中的依赖项,而不是删除行:
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
来自build.gradle,我们在Google Play上编译并上传... Tadaaaa! 8233台设备。为什么会这样?我们不知道:Android Studio在您使用Apache.Commons.IO函数时会添加此行,而Google Play无法识别此lib ... boh!谢谢你的帮助。