我试图将react-native-google-cast添加到我的项目中,但是每次我构建android项目时,我都会收到错误消息:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-google- cast:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
第一个错误是:
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/../GoogleCastActivity.java:14: error: package android.support.v7.app does not exist
import android.support.v7.app.AppCompatActivity;
几天前我一直在为我绝对疯狂,我几天前还在存储库here中添加了一个问题。
我尝试过的事情:
implementation 'com.android.support:appcompat-v7:+'
添加到build.gradle文件中,许多提到error: package android.support.v7.app does not exist
的SO帖子中都建议使用在github上的README.md中完成了几次安装指南,并完成了故障排除部分
Android:如果您的应用程序兼容版本冲突(或 google play服务)库,请确保您全局设置版本 在项目的顶级build.gradle中:
buildscript { ext { buildToolsVersion = '27.0.3' minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = '26.1.0' castFrameworkVersion = '16.1.2' } ... }
但是我没有运气尝试
这些是我正在使用的版本:
"react": "16.8.6",
"react-native": "0.60.3",
"react-native-google-cast": "^3.1.3"
请让我知道我是否还缺少其他相关信息,我们将不胜感激!