GVKun编程网logo

在 react-native 中发出网络请求的问题 - iOS 和 Android(react native 请求数据)

1

本文将介绍在react-native中发出网络请求的问题-iOS和Android的详细情况,特别是关于reactnative请求数据的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了

本文将介绍在 react-native 中发出网络请求的问题 - iOS 和 Android的详细情况,特别是关于react native 请求数据的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于Android React-Native react-native-push-notification:compileDebugJavaWithJavac 失败、iOS React Native:只有在有 RN 更改时“捆绑 React Native 代码和图像”、ios – React native error – react-native-xcode.sh:line 45:react-native:command not found命令/ bin/sh失败,退出代码127、React Native & react-native-web-player & React Native for Web的知识。

本文目录一览:

在 react-native 中发出网络请求的问题 - iOS 和 Android(react native 请求数据)

在 react-native 中发出网络请求的问题 - iOS 和 Android(react native 请求数据)

如何解决在 react-native 中发出网络请求的问题 - iOS 和 Android

我在使用 axios 和 react-native-config 进行网络请求时遇到问题。在我的调试器中,我得到 file:///

直到今天一切都很好

注册护士 0.63

我找不到解决方法

我试过重新安装 react-native-debugger 我已经尝试清理所有 Pod 并清理项目

See screenshot from RNBebugger

See screenshot from App

NSExceptionDomains 设置在 Info.plist

和来自终端的 SS

enter image description here

有什么办法可以解决这个问题?

Android React-Native react-native-push-notification:compileDebugJavaWithJavac 失败

Android React-Native react-native-push-notification:compileDebugJavaWithJavac 失败

如何解决Android React-Native react-native-push-notification:compileDebugJavaWithJavac 失败

经过 Firebase 于 2021 年 5 月 11 日的一些重大更改。我正面临此错误 react-native-push-notification:compileDebugJavaWithJavac Failed
下面我将分享以下关于依赖项及其版本的要点。

react-native-push-notification": "^6.1.1"  
@react-native-firebase/messaging": "7.9.0","@react-native-firebase/app": "8.4.5",buildscript {  
ext {  
    buildToolsversion = "28.0.3"  
    minSdkVersion = 16  
    compileSdkVersion = 29  
    targetSdkVersion = 29  
    supportLibVersion = "28.0.0"   
    googlePlayServicesAuthVersion = "16.0.1"
}

解决方法

这只是 Android Gradle 的问题,因为 FirebaseInstanceId 已被弃用,因此,Android 在构建时失败。为了解决这个问题,您可以执行这些操作,您的应用就会恢复正常。

  • implementation ''com.google.firebase:firebase-messaging:21.1.0'' 添加到 android/app/build.gradle。请注意,如果您已经有了 implementation ''com.google.firebase:firebase-messaging'',请务必评论,并添加答案中提到的内容。
  • firebaseMessagingVersion=21.1.0 添加到 android/gradle.properties

之后,通过在 Mac 上执行 cd android && ./gradlew clean 或在 cd android && gradlew cleanWindows 项目上执行 terminal 来清理 Android 项目,然后然后使用 npm run android 运行应用程序。

iOS React Native:只有在有 RN 更改时“捆绑 React Native 代码和图像”

iOS React Native:只有在有 RN 更改时“捆绑 React Native 代码和图像”

如何解决iOS React Native:只有在有 RN 更改时“捆绑 React Native 代码和图像”

每次在 Xcode 中编辑不相关的项目文件时,都会发生“捆绑 React Native 代码和图像”构建阶段。

您可以通过什么方式将此构建阶段配置为仅在需要重新捆绑 RN 代码和图像时发生?

ios – React native error – react-native-xcode.sh:line 45:react-native:command not found命令/ bin/sh失败,退出代码127

ios – React native error – react-native-xcode.sh:line 45:react-native:command not found命令/ bin/sh失败,退出代码127

尝试构建任何(新的或旧的)项目时出现此错误.
我的节点是版本4.2.1,react-native是版本0.1.7.
我看过其他有相同问题的人,所以我已经更新了本机的最新版本,但是我仍然无法通过 xcode构建任何项目.

解决方法

要解决此问题,请使用以下步骤:

>使用节点版本v4.2.1
> cd进入[你的应用] / node_modules / react-native / packager
> $sh ./packager.sh(出于某种原因,运行正常)
>进入XCode并转到Build Phases选项卡.
删除列表中的最后一项(运行脚本的项目).所以你留下了Target Dependencies,Compile Sources,Link Binary With Libraries和copy Bundle Resources.

现在点击XCode中的build.由于shell脚本不再是XCode构建例程的一部分,因此它不应该失败.如果你在另一个终端窗口中运行react本机客户端服务器,那么一切都应运行正常.

React Native & react-native-web-player & React Native for Web

React Native & react-native-web-player & React Native for Web

React Native & react-native-web-player & React Native for Web

https://github.com/dabbott/react-native-web-player

https://dabbott.github.io/react-native-web-player/


import React, { Component } from ''react''
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} from ''react-native''

class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <View style={{height: 100, width: "100%" }}>
          <View style={{flex: 1, backgroundColor: ''powderblue''}} />
          <View style={{flex: 2, backgroundColor: ''skyblue''}} />
          <View style={{flex: 3, backgroundColor: ''steelblue''}} />
        </View>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: ''center'',
    alignItems: ''center'',
    backgroundColor: ''#F5FCFF'',
  },
  welcome: {
    fontSize: 20,
    textAlign: ''center'',
    margin: 10,
  },
})

// no need below line  if use react-native -create-app
AppRegistry.registerComponent(''App'', () => App)


https://github.com/necolas/react-native-web

https://necolas.github.io/react-native-web/storybook/

https://necolas.github.io/react-native-web/examples/


https://bbs.reactnative.cn/topic/3727/%E6%96%B0%E5%8A%A0%E5%9D%A1-grab%E6%8B%9Breact-native%E5%BC%80%E5%8F%91/5


我们今天的关于在 react-native 中发出网络请求的问题 - iOS 和 Androidreact native 请求数据的分享就到这里,谢谢您的阅读,如果想了解更多关于Android React-Native react-native-push-notification:compileDebugJavaWithJavac 失败、iOS React Native:只有在有 RN 更改时“捆绑 React Native 代码和图像”、ios – React native error – react-native-xcode.sh:line 45:react-native:command not found命令/ bin/sh失败,退出代码127、React Native & react-native-web-player & React Native for Web的相关信息,可以在本站进行搜索。

本文标签: