android - Apk 中找不到r类文件
PHP中文网
PHP中文网 2017-04-17 17:56:58
0
2
375

使用Android Studio打包apk,解压在里面找不到R相关的文件,使用debug 模式生成的apk里面却有,这是build.gradle配置
` buildTypes {

    release {
        minifyEnabled true
        debuggable false
        buildConfigField("boolean", "LOG_DEBUG", "false")
        versionNameSuffix "-release"
        zipAlignEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        signingConfig signingConfigs.release
    }

    debug {
        applicationIdSuffix ".debug"
        debuggable true
        shrinkResources false
        buildConfigField("boolean", "LOG_DEBUG", "true")
        versionNameSuffix "-debug"
        zipAlignEnabled true

        signingConfig signingConfigs.debug
    }
}

productFlavors {
    wandoujia {
        applicationIdSuffix ".wandoujia"
    }

    xiaomi {
        applicationIdSuffix ".xiaomi"
        manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
    }
}`

不是什么非要解决的问题,只是觉得这个挺奇怪的,如果找不到r类文件,又怎么匹配到资源文件的呢?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
伊谢尔伦

Use as, or try rebuilding

伊谢尔伦

In the default configuration, the R file will not be included in the apk. When compiling, the value in the R file referenced in the code will be replaced with a specific value. You can just find an activity to see the ID of the layout file. It is a specific Numbers

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!