Android 应用支持零设备?

Android app supports zero devices?

我已经阅读了所有与这个问题相关的SO问题,但是none帮助我解决了这个问题。我上传了一个早期的 alpha,它支持大约 8000+ 设备,但根据 Google Play.

,当前版本支持零。

我只有两个使用权限声明,没有使用功能声明。我已经尝试删除使用许可声明,但是(尽管我收到另一个关于不存在计费的警告)据称我仍然支持零设备,即使没有那些。

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hearttech.intimacytoolbox" >

    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name=".Application"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_shortname"
        android:theme="@style/Theme.NoTitle" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_shortname"
            android:launchMode="singleTop" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        [SNIPPED a bunch of other activities from here for length]
    </application>
</manifest>

build.gradle:

apply plugin: 'com.android.application'
android {
    signingConfigs {
        config {
            keyAlias 'IntimacyToolboxKey'
            keyPassword 'fakepassword'
            storeFile file('/Users/dave/Dropbox/Intimacy Toolbox/android/Ancillaries/android.jks')
            storePassword 'fakepassword'
        }
    }
    compileSdkVersion 23
    buildToolsVersion "23"
    defaultConfig {
        applicationId "com.hearttech.intimacytoolbox"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 3
        versionName '0.2'

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            debuggable true
        }
    }
    sourceSets {
        main { assets.srcDirs = ['src/main/assets'] }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile('org.simpleframework:simple-xml:2.7.1') {
        exclude module: 'stax'
        exclude module: 'stax-api'
        exclude module: 'xpp3'
    }
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.google.guava:guava-collections:r03'
    compile 'com.google.guava:guava-io:r03'
    compile 'com.google.guava:guava-base:r03'
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.android.support:support-annotations:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    compile 'org.apache.directory.studio:org.apache.commons.codec:1.8'
    compile 'com.anjlab.android.iab.v3:library:1.0.27'
}

我在某些地方看到重复的库会导致这个问题,但我没有在使用 jcenter 的依赖系统之外添加任何东西。在 gradle 日志输出中,它仅列出这些已准备好的库:

:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72300Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareUkCoChrisjenxCalligraphy210Library UP-TO-DATE

对于 Google Play 为何认为我不支持任何设备的任何见解,我将不胜感激。提前致谢!

尽管 gradle 应该为您完成此操作,但请尝试将其添加到您的应用程序清单中。

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="23" />

所以,问题原来是 Apache Commons 编解码器库。我已经使用 jcentral 导入了库,jcentral 是 Android Studio 的默认存储库。这对于我需要的其他库来说效果很好,但对于 Apache Commons,当以这种方式上传 APK 时,Google Play APK 上传器将 commons-codec-1.8.jar 列为 "Native Platform"该应用程序,这显然使该应用程序与所有设备不兼容。

为了解决这个问题,我从 Apache Commons 网站下载了 .jar 文件并将其添加到我的 [项目根目录]/app/libs 目录中,并从 gradle.build 中删除了依赖行。这解决了问题!