本文介绍了Android应用程序支持零设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了与该问题相关的所有SO问题,但是没有一个问题可以帮助我解决该问题.根据Google Play的说法,我上传了一个早期的Alpha版本,该版本支持大约8000多种设备,但是当前版本支持的零版本.

我只有两个uses-permission语句,而没有uses-feature语句.我曾尝试删除使用许可"语句,但是(尽管我收到另一个关于缺账的警告,但据称我仍然支持零设备,即使没有这些设备.

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为什么认为我不支持任何设备的任何见解,我将不胜感激.预先感谢!

解决方案

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

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

I've read all the SO questions that are related to this question, but none have helped me solve this problem. I uploaded an early alpha, which supported about 8000+ devices, but the current version supports zero, according to Google Play.

I have only two uses-permission statements, and no uses-feature statements. I've tried removing the uses-permission statements, but (although I get another, different warning about the billing one being absent) I still allegedly support zero devices, even without those.

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'
}

I've seen in places that duplicate libraries can cause this problem, but I haven't added anything outside of the dependency system that uses jcenter. In the gradle log output, it lists only these libraries as having been prepared:

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

I would appreciate any insight as to why Google Play thinks I don't support any devices. Thanks in advance!

解决方案

So, the problem turned out to be the Apache Commons codec library. I had imported the library using jcentral, the default repository for Android Studio. That worked fine for the other libraries I needed, but for Apache Commons, when uploading the APK that way, Google Play APK uploader lists commons-codec-1.8.jar as a "Native Platform" for the app, which apparently makes the app incompatible with all devices.

To fix the problem, I instead downloaded the .jar file from the Apache Commons website and added it to my [project root]/app/libs directory, and removed the dependency line from gradle.build. This fixed the problem!

这篇关于Android应用程序支持零设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 15:20