[英]react native android/app/build.gradle file missing
I'm new to react native and I would like to create a simple app working with firebase push notifications.我是本机反应的新手,我想创建一个使用 firebase 推送通知的简单应用程序。
So I've created my react app using 'expo init'所以我使用“expo init”创建了我的反应应用程序
Now I'm stuck at point 2 of this tutorial https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/android.md现在我被困在本教程的第 2 点https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/android.md
In the tutorial, it says "apply xyz to your android/app/build.gradle" but the problem is that I have no such file, also in many other tutorials of react native this file is mentioned... do I have to create this file myself or should this file normally be created automatically?在教程中,它说“将 xyz 应用到你的 android/app/build.gradle”但问题是我没有这样的文件,在许多其他的 react native 教程中也提到了这个文件......我是否必须创建这个文件自己还是应该自动创建这个文件?
To be more specific, I don't have an "android" directory.更具体地说,我没有“android”目录。 just many android folders in the node_modules folder
node_modules 文件夹中只有许多 android 文件夹
I've added a screenshot of my top-lvl folder structure.我添加了我的顶级文件夹结构的屏幕截图。
In Expo you have a 'managed' vs. 'bare' workflow ( https://docs.expo.io/versions/v34.0.0/introduction/managed-vs-bare/ )在世博会上,您有一个“托管”与“裸”工作流程( https://docs.expo.io/versions/v34.0.0/introduction/managed-vs-bare/ )
If you want to edit the gradle file you'll need to eject to a bare workflow:如果你想编辑 gradle 文件,你需要弹出一个裸露的工作流程:
Unlike in the managed workflow where you don't touch the underlying native code directly, in this workflow the developer has complete control, along with the complexity that comes with that.
与您不直接接触底层本机代码的托管工作流不同,在此工作流中,开发人员拥有完全的控制权,以及随之而来的复杂性。
If I remember correctly, you can use the CLI tools and just type 'expo eject'.如果我没记错的话,您可以使用 CLI 工具并输入“expo eject”。 The Android folder and all project files will then be created.
然后将创建 Android 文件夹和所有项目文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.