Sam*_*Sam 9 android auth0 react-native
自从我将物理设备连接到我的计算机来测试我的 React Native 项目后,我就开始遇到这个问题。在物理设备出现之前,相同的代码无需任何更改即可在我的计算机上正常运行,并且我能够在 Android 模拟器上安装并测试它。
现在,我不断收到以下错误,并且应用程序无法构建。错误是:
配置项目“:react-native-auth0”时出现问题。
未找到名称为“compile”的配置。
错误指向\node_modules\react-native-auth0\android\build.gradle包含以下代码的文件:
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.bootClasspath)
classpath += files(project.getConfigurations().getByName('compile').asList()) // <-- The error is pointing to this line
include '**/*.java'
}
Run Code Online (Sandbox Code Playgroud)
正如我所说,使用 Android 模拟器在我的笔记本电脑上一切正常。自从连接和配置物理设备后,我什至无法再构建项目。
知道问题是什么以及如何解决它吗?
有两种可能的解决方案
注释掉指示的 build.gradle 文件中有问题的行(并可能通过patch-package创建补丁)
//classpath += files(project.getConfigurations().getByName('compile').asList()) // <-- The error is pointing to this line
Run Code Online (Sandbox Code Playgroud)
通过在 android/build.gradle 文件末尾添加以下行来确保存在编译配置
subprojects { subproject ->
if(project['name'] == 'your-package-name'){
project.configurations { compile { } }
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5279 次 |
| 最近记录: |