如何从strings.xml

时间:2019-04-18 12:59:07

标签: java android build.gradle

我想从build.gradle中的strings.xml获取onesignal应用程序ID

strings.xml

<string name="onesignal_id">ONESIGNAL_APP_ID</string>

我的代码

android {
    defaultConfig {
        manifestPlaceholders = [
                onesignal_app_id               : 'ONESIGNAL_APP_ID',
                // Project number pulled from dashboard, local value is ignored.
                onesignal_google_project_number: 'REMOTE'
        ]
    }
}

想要这样设置

android {
    defaultConfig {
        manifestPlaceholders = [
                onesignal_app_id               : 'R.string.onesignal_id(example)',
                // Project number pulled from dashboard, local value is ignored.
                onesignal_google_project_number: 'REMOTE'
        ]
    }
}

0 个答案:

没有答案