【问题标题】:can't find referenced method boolean isInstantApp() in library class android.content.pm.PackageManager在库类 android.content.pm.PackageManager 中找不到引用的方法 boolean isInstantApp()
【发布时间】:2018-05-30 13:46:44
【问题描述】:

在 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】:

解决了我的问题,我只是更新 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'
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-28
    • 2016-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多