标签: react-native-android

在 react-native 项目中包含 scss?

有没有办法在本机应用程序中使用 scss 文件?我只是好奇并且对 react-native 应用程序架构没有太多了解,但是我想使用我当前的项目 scss 文件来处理我们计划构建的新 react-native-android 项目。

反应原生版本:“0.46.4”

反应版本:“16.0.0-alpha.12”

BABEL-PRESET-REACT-NATIVE:“2.1.0”

更新 :

我搜索了一点发现css-to-react-native这有点让我将我的 css 转换为 react-native 样式表对象,对我来说有点解决方法。

谢谢。

react-native react-native-android

8
推荐指数
2
解决办法
2万
查看次数

React native生成ProGuard映射文件

我正在使用firebase运行崩溃报告,并且非常希望看到错误堆栈跟踪.

我收到消息:

Upload a ProGuard mapping file to deobfuscate future stack traces for version X
Run Code Online (Sandbox Code Playgroud)

我只是不确定如何从react-native生成文件.

任何帮助赞赏.谢谢

android android-studio react-native react-native-android

8
推荐指数
1
解决办法
277
查看次数

React原生iOS中的垂直居中自定义字体

在 Expo 中使用 React Native。在 iOS 中难以将自定义导入的字体居中。Android 渲染没有问题,文本垂直居中完美。使用 iOS 它比中心略高。

(原生字体很好地集中在两个模拟器上 - Android 和 iOS)。

任何想法如何解决?

代码如下:

import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Font } from 'expo';

export default class  extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isReady: false
    };
  }

  async componentDidMount() {
    await Font.loadAsync({
      'KlavikaBold': require('./KlavikaBold.otf'),
    });
    this.setState({ isReady: true });
  }

  render() {
    if (!this.state.isReady) {
      return <Expo.AppLoading />;
      }
    return (
      <View style={styles.container}> …
Run Code Online (Sandbox Code Playgroud)

css react-native react-native-android react-native-ios

8
推荐指数
2
解决办法
4452
查看次数

React-Native 应用程序逆向工程和混淆

react-native expo 生成的 apk 是否被混淆?

exp build:android
Run Code Online (Sandbox Code Playgroud)

如何使用该 apk 取回我的 React Native JS 源代码?为此,我是否需要 dex 到 Java 编译器?

寻找您的宝贵建议,因为我担心我的 React Native 应用程序的安全性并试图比较混淆代码与非混淆代码

reverse-engineering apk react-native react-native-android expo

8
推荐指数
1
解决办法
4870
查看次数

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_DEXOPT

在 android 模拟器中运行我的应用程序时出现错误

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_DEXOPT

react-native react-native-android

8
推荐指数
2
解决办法
7323
查看次数

短信代码已过期。请重新发送验证码重试

每当我尝试使用 react-native-firebase sdk 使用电话号码登录时,我都会通过短信收到 OTP 代码,当我提交收到的代码时,会出现错误消息:“短信代码已过期。请重新发送验证码再试一次。” 在这里要注意的是,即使出现错误,相应电话号码的条目也会写入 firebase 的“用户”部分。

我正在使用以下内容:

NodeJS: v8.11.1,
NPM: v5.6.0,
react-native: "^0.59.9",
react-native-firebase: "^5.5.3"
Run Code Online (Sandbox Code Playgroud)

我已经尝试过的一些链接是:

1. https://github.com/invertase/react-native-firebase- 
docs/blob/master/docs/auth/phone-auth.md
2. /sf/ask/3256590851/ 
authentication-error-the-sms-code-has-expired
3. https://www.bountysource.com/issues/45308170-firebase-phone- 
number-auth-integration
4. https://medium.com/@chrisbianca/getting-started-with-firebase- 
authentication-on-react-native-a1ed3d2d6d91
5. https://invertase.io/oss/react-native-firebase/v6/auth/phone- 
auth
Run Code Online (Sandbox Code Playgroud)

在 MobileRegistration.js 中:

navigateToOtpScreen() {
console.log("Phone number: ", "+91" + this.state.phoneNumber)
firebase.auth().signInWithPhoneNumber("+91" + 
this.state.phoneNumber)
.then(confirmResult => {
   this.setState({ confirmResult, message: 'Code has been sent!'})
   this.props.navigation.navigate('EnterOtp', { 'confirmResult': 
   confirmResult})
 })
 .catch(error => {
      alert(error.message);
      this.setState({ message: `Sign In With Phone Number Error: 
      ${error.message}` })
  });
Run Code Online (Sandbox Code Playgroud)

};

在 …

react-native firebase-authentication react-native-android react-native-firebase

8
推荐指数
1
解决办法
9439
查看次数

如何为 IOS 生成 Release 版本..?

Android Release Build 从我这边成功完成,但我不知道如何为 IOS 生成构建

Androidgradlew assembleRelease是sucessfully从我这边完成的

IOS 发布构建并提交到应用商店。

react-native react-native-android react-native-ios

8
推荐指数
2
解决办法
4904
查看次数

React Native Maps:自定义标记在 android 上导致极度滞后和变慢

我在地图上加载了大约 2000 个标记。它在前几秒钟工作正常,但随后急剧减速。要修复它,我需要清除应用程序数据,然后它只能像以前一样工作几秒钟。

const mapMarkers = [
    {id: 1, code: "603778", lat: 35.761791, lng: 51.389438},
    {id: 2, code: "788621", lat: 35.712278, lng: 51.361785},
    {id: 3, code: "129667", lat: 35.674757, lng: 51.485328},
    {id: 4, code: "999646", lat: 35.772885, lng: 51.446735},
    {id: 5, code: "111524", lat: 35.755656, lng: 51.446774},
    //...
];

let markers = mapMarkers.map(marker => {
    return (<Marker
        key={marker.code}
        coordinate={{latitude: marker.lat, longitude: marker.lng}}
        image={require('./images/markers.png')}
        onPress={() => console.log("pressed")}
    />)
});
Run Code Online (Sandbox Code Playgroud)

我测试了emulator并且physical device两者都有问题。

提示:我将react-native-map-clustering包用于标记集群。

google-maps react-native react-native-android react-native-maps react-native-map-clustering

8
推荐指数
1
解决办法
4403
查看次数

react-native-google-places-autocomplete 不起作用

react-native-google-places-autocomplete 不起作用,我面临多个问题 1. 位置下拉没有显示 2. onPress 处理程序根本没有触发

注意:已启用所有 google location apis、google maps api、places api 和 geocode api,并提供有效的 api 密钥。

我尝试了 Internet 上所有可用的解决方案 1. 将 zIndex: 1000 设置为一个高值,以避免将其隐藏在其他视图后面 2. 尝试创建新的 RN App 并仅添加此组件以保持项目清洁 3. 引用其他SO 帖子和试图修复它

这里是代码片段

<GooglePlacesAutocomplete
  placeholder="Search"
  minLength={2} // minimum length of text to search
  autoFocus={false}
  fetchDetails={true}
  onPress={(data, details = null) => {
    // 'details' is provided when fetchDetails = true
    console.log(data);
    console.log(details);
  }}
  getDefaultValue={() => {
    return ''; // text input default value
  }}
  query={{
    // available …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android

8
推荐指数
2
解决办法
8199
查看次数

使用 React Native 设置 Android 模拟器的问题

我是 React Native 的新手,并尝试使用 Visual Studio 设置 Android 环境。所有安装都相当成功,但是,当我尝试在执行npx react-native run-android命令的 android 模拟器上运行示例应用程序时,它显示以下错误 -

'C:\Users\Home' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
        at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
        at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
        at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
Run Code Online (Sandbox Code Playgroud)

但是,当我adb devices在 Visual Studio …

android-emulator react-native react-native-android

8
推荐指数
2
解决办法
7255
查看次数