在库类android.content.pm.PackageManager中找不到引用的方法boolean isInstantApp()

问题描述 投票:1回答:1

我在android studio 3中生成签名的apk时遇到两个错误,当我尝试构建它成功构建时。请帮助解决此错误的方法。

但是当我尝试生成签名的apk时,我得到以下错误。

警告:com.google.android.gms.internal.zzbga:在库类android.content.pm.PackageManager中找不到引用的方法'boolean isInstantApp()'

警告:com.google.android.gms.internal.zzbgb:在库类android.content.pm.PackageManager中找不到引用的方法'boolean isInstantApp(java.lang.String)'

以下是我的build.gradle文件代码。

  apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.micropeda.sudoku"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 20171216
        versionName "2.4.1"
    }


  buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.google.android.gms:play-services-ads:11.6.2'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.instantapps:instantapps:1.1.0'
}
java android android-layout android-studio apk
1个回答
1
投票

解决了我自己,我只是更新了build.gradle文件。这是我更新的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.1'

    defaultConfig {
        applicationId "com.micropeda.sudoku"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 20171216
        versionName "2.4.1"
    }


 buildTypes {
      release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation 'com.google.android.gms:play-services-ads:11.6.2'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.instantapps:instantapps:1.1.0'
}
© www.soinside.com 2019 - 2024. All rights reserved.