从 Google PlayStore 下载应用程序时出现错误 _504 或错误 - 108 ..代码中出现此错误的原因是什么?

Error _504 or error - 108 appears when app is downloaded from Google PlayStore ..What can be causes of this errors in the code?

从 Playstore 下载应用程序时出现错误 -504 或错误 - 108。 我努力工作了大约一年并创建了一个 app.Signed 它并将其上传到 playstore 因为 Beta.I 已经调试和测试了该应用程序 - 该应用程序似乎运行良好。6/10 人能够安装该应用程序和 运行 it.But 在其余设备上应用程序商店显示错误代码 - 504 和错误代码 - 108。 在我的 gradle 中,我支持许多 minSdk 低至 15 的设备。 该应用程序似乎在 android 7.1 中运行良好 devices.But 其他具有相同 android 版本和配置的设备...在安装过程中显示错误..或下载..!(代码- 504/代码-108) 这些错误会因我的 gradle 或 mainifest 文件而出现吗?

这是我的文件片段:-

build.gradle(项目)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.0'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(模块)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.backbenchers.administrator.instaclone"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 2
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    //firebase core
    implementation 'com.google.firebase:firebase-core:10.2.6'

    //bottom navigation view lib
    implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'

    //circle image view
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    //universal image loader
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    //firebase authentication
    implementation 'com.google.firebase:firebase-auth:10.2.6'

    //firebase realtime database
    implementation 'com.google.firebase:firebase-database:10.2.6'

    //firebase storage
    implementation 'com.google.firebase:firebase-storage:10.2.6'



    //recycler view
    implementation 'com.android.support:recyclerview-v7:27.0.2'

    //cardview
    implementation 'com.android.support:cardview-v7:27.0.2'



    //custom tabs chrome lib
    implementation 'com.android.support:customtabs:27.0.2'

    //play services auth
    implementation 'com.google.android.gms:play-services-identity:10.2.6'
    implementation 'com.google.android.gms:play-services-auth:10.2.6'


///there are more library implemetations...


    //youtube api
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

}

///Firebase
apply plugin: 'com.google.gms.google-services'

Manifest.xml

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

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

    <application
        android:name=".Utils.FirebaseOffline"
        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=".Register.NewRegisterActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
        
        .....all other activities used in the app...remains here

这个错误不是由于捕获或这些设备的设置有问题。我认为代码有问题。

请帮助我了解代码中可能导致这些错误的潜在原因...!...我迷路了...!

错误 504 是网关超时错误,通常与较慢的互联网连接或移动数据有关 networks.You 可以检查此 link.

中提供的方法

Method 1:

  • Go to Settings>> Application Manager or Apps>> Open “All” apps
  • From the list of apps find Google Play store >>Clear Data and Clear Cache
  • From the list of apps find Google Service Framework >> Clear Data and Clear Cache
  • Now install or update app from Google Play Store

Method 2:

  • Go to system settings>> Accounts>>Google>>remove your Gmail account
  • Now from settings>>Apps>>All> Force stop, Clear data and cache for Google Play Store, Google Service Framework and Download Manager (like in method 1)
  • Now again go to settings>> Accounts>>Google>>Add your gmail account
  • Restart your android and then accept all the Google terms and 504setup Google settings
  • Rerun Google Play Store and update or install your app.

希望对您有所帮助!

后来我找到了解决问题的办法。 这是因为在 java 文件夹中命名包时有 "Uppercase" 个字母。 在 android 版本 N 或更高版本中,它没有显示任何解析或错误 -504 或错误 - 108。 但是在低于 N 的 android 版本中无法正确安装该软件包。 问题是 android studio 在 java 文件夹中命名包时从不显示警告。就像命名资源时一样 始终以小写字母命名 JAVA 文件夹中的包*