我正在使用我在本地安装的这个库作为模块。我可以通过我的主项目访问它,但我不能做相反的事情。例如,从这个库访问我的主项目中的一个变量......
我尝试在库中添加这一行build.gradle:
implementation project(':app')
Run Code Online (Sandbox Code Playgroud)
但我收到了这个奇怪的错误:
Circular dependency between the following tasks:
:placepicker:generateDebugRFile
\--- :placepicker:generateDebugRFile (*)
(*) - details omitted (listed previously)
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?我的项目在 Java 中,我的库在 Kotlin 中
该库包含 1 个错误。
它在这里修复:https : //github.com/heinrichreimer/material-intro/pull/287
将这个固定版本的库实现到我的 Android Studio 项目的最简单方法是什么?我是使用 GitHub 库的新手,我很感激这方面的一些帮助。
我目前正在使用这个: implementation 'com.heinrichreimersoftware:material-intro:2.0.0'
我使用此代码来检测手机上是否启用了开发人员选项:
int developerOptions = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);
Run Code Online (Sandbox Code Playgroud)
但是,我对此进行了测试,它在少数设备上返回错误的值(一些华为手机和其他......)
是否有另一种完整的方法来检测设备中是否启用了开发人员选项?
我尝试了这个,但它不起作用(无论如何我不想使用该方法,因为它不优雅,我只是在测试):
try
{
startActivityForResult(new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS), 8080);
finishActivity(8080);
// Developer options enabled
}
catch (Exception e)
{
// Developer options disabled
}
Run Code Online (Sandbox Code Playgroud)
我的应用程序的最低 API 级别是 21。
我已经查看了这个问题和其他类似的问题,但我没有找到完整的解决方案。这不是一个重复的问题。