反应原生 android/app/build.gradle 文件丢失 [英] react native android/app/build.gradle file missing

查看:33
本文介绍了反应原生 android/app/build.gradle 文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是本机反应的新手,我想创建一个使用 firebase 推送通知的简单应用.

所以我使用expo init"创建了我的反应应用

现在我被困在本教程的第 2 点

解决方案

在 Expo 中,您有一个托管"与裸"工作流 (https://docs.expo.io/versions/v34.0.0/introduction/managed-vs-bare/)

如果你想编辑 gradle 文件,你需要弹出一个空的工作流程:

<块引用>

与您不直接接触底层本机代码的托管工作流不同,在此工作流中,开发人员拥有完全控制权,以及随之而来的复杂性.

如果我没记错的话,您可以使用 CLI 工具并输入expo eject".然后将创建 Android 文件夹和所有项目文件.

I'm new to react native and I would like to create a simple app working with firebase push notifications.

So I've created my react app using '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

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?

To be more specific, I don't have an "android" directory. just many android folders in the node_modules folder

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/)

If you want to edit the gradle file you'll need to eject to a bare workflow:

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'. The Android folder and all project files will then be created.

这篇关于反应原生 android/app/build.gradle 文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆