简体   繁体   English

反应原生 android/app/build.gradle 文件丢失

[英]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.

相关问题 React Native:build.gradle 文件中的 Android Gradle 插件和 ZE84E30B9390CDB64DB6DB2C9D 有什么区别? - React Native: what's the difference between Android Gradle Plugin in build.gradle file and Android Studio? React Native和build.gradle - React Native and build.gradle 您是否在 `app/build.gradle` 中添加了多个构建脚本,以便在 React Native 中手动进行 Android 链接? - Do you add multiple buildscripts in `app/build.gradle` for manual Android linking in React Native? 我应该更新哪个build.gradle文件以在React Native Android项目中添加结构数字 - Which build.gradle file should I be updating to add fabric digits in a React Native Android project 应用程序的android build.gradle文件-什么是默认存储库 - android build.gradle file for app - what is default repository Android Studio中哪个build.gradle文件 - which build.gradle file Android studio Android Studio build.gradle文件错误 - Android Studio build.gradle file error android studio canary 中的 build.gradle 文件 - build.gradle file in android studio canary 运行 react-native run-android 时出错:build.gradle 中的意外令牌 - Error running react-native run-android: Unexpected Token in build.gradle 电容器(build.gradle 不存在/不允许操作)React app to Android 无法构建 - Capacitor (build.gradle does not exist/operation not permitted) React app to Android can't build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM