We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
开始 Music 环境配置如下,并且已切换当前环境为测试环境:
/** * 特殊模块 Music 的环境 */ @Module(alias = "音乐") private class Music { @Environment(url = "https://www.codexiaomai.top/api/", isRelease = true, alias = "正式") private String online; @Environment(url = "http://test.codexiaomai.top/api/", alias = "测试") private String test; }
当修改 Music 模块的配置后(修改地址)
/** * 特殊模块 Music 的环境 */ @Module(alias = "音乐") private class Music { @Environment(url = "https://www.1222", isRelease = true, alias = "正式") private String online; @Environment(url = "http://test.2323", alias = "测试") private String test; }
重新运行项目后,获取当前模块环境时会发生 NPE。
bug 原因: 获取当前模块环境时,只有在 SharedPrefrences 中当前模块的地址和配置中的某个地址匹配时,才会给当前模块环境赋值,如果地址修改了,导致配置中没有地址和 SharedPreferences 中的地址匹配,所以当前模块为 NULL。
解决方案: 当配置中没有地址和 SharedPreferences 中的地址匹配时,当前模块指定为 DEFAULT(isRelease = true) 环境。
The text was updated successfully, but these errors were encountered:
#8 fix bug
ecf1941
No branches or pull requests
开始 Music 环境配置如下,并且已切换当前环境为测试环境:
当修改 Music 模块的配置后(修改地址)
重新运行项目后,获取当前模块环境时会发生 NPE。
bug 原因:
获取当前模块环境时,只有在 SharedPrefrences 中当前模块的地址和配置中的某个地址匹配时,才会给当前模块环境赋值,如果地址修改了,导致配置中没有地址和 SharedPreferences 中的地址匹配,所以当前模块为 NULL。
解决方案:
当配置中没有地址和 SharedPreferences 中的地址匹配时,当前模块指定为 DEFAULT(isRelease = true) 环境。
The text was updated successfully, but these errors were encountered: