草庐IT

react-templates

全部标签

android - 无法在 Redmi 手机上运行 react-native 应用程序?

我正在尝试将我的react-nativeapk上传到redminote3,但在将gradle从1.3.1降级到1.2.3后遇到无法上传某些apk的错误我能够找到它,但在成功上传应用程序我只能看到空白的白屏。我看不到任何应用程序屏幕。我关注了https://github.com/facebook/react-native/issues/2720但仍然没有找到任何成功。我使用过两个版本的redmi手机,一个是5.0.2android版本的redminote3和4.4.4android版本的Mipad,两者都面临同样的问题,即黑屏。 最佳答案

android - React Native 和 Android 后台服务

我使用Headless.js通过ReactNative运行后台服务。我们在使用它时面临很多问题。使用ReactNative运行Android后台服务有哪些选择? 最佳答案 添加文件名BackgroundAudio.javaimportandroid.content.Intent;importandroid.os.Bundle;importcom.facebook.react.HeadlessJsTaskService;importcom.facebook.react.bridge.Arguments;importcom.facebo

android - NoClassDefFoundError com.facebook.react.bridge.WritableNativeMap

我在尝试加载jsbundle(离线React应用程序)时随机崩溃mReactInstanceManager=ReactInstanceManager.builder().setApplication(mActivity.getApplication()).setJSBundleFile(appPath).addPackage(mReactPackage).addPackage(newMyCustomReactPackage()).setUseDeveloperSupport(false)//Forperformanceusefalse.setInitialLifecycleState(

android - react-native:无法识别命令 `run-android`。可能是由 npm install 引起的

最近我开始遇到这个问题,当我安装一个react-native包时(例如:react-navigation)到我的项目中,一大堆包都被删除了(我认为包括react,react-native)。然后当我尝试运行命令“run-android”时,它说无法识别。我最近更新到最新的npm和react-native-cli。“npminstall”有问题吗?还是react-native?nodeversion:8.1.2react-native-cli:2.0.1react-native:0.45.1react-navigation:1.0.0-beta.11以下是重新创建的步骤:Step1-Cr

android - react native : Elevation Style Property - Change shadow direction

我可以在ReactNative上更改elevation样式属性(仅限android)的阴影方向吗?通常阴影显示在元素的底部,但我想在顶部显示它。谢谢 最佳答案 如果您谈论的是Android(我假设是因为elevation在iOS上不存在),不,您不能。虚拟“创建”阴影目前来自固定光点(参见https://material.io/guidelines/material-design/environment.html#environment-light-shadow)。 关于android-

android - 通过在后台运行的推送通知做出 native react

我正在尝试使用此插件实现推送通知react-native-push-notifications.我成功的是在应用程序运行时(在前台)获得通知,但我想要做的是在应用程序关闭(后台)、未运行以及我收到进入应用程序的通知时获得通知。我的代码componentDidMount(){this.initEventPushNotification()this.initPushNotification()}initEventPushNotification(){AppState.addEventListener('change',(state)=>{console.log(state)if(state

android - react native Android FCM : Didn't get a token

我在我的React-Native应用程序中使用react-native-fcm。我正在使用以下方法获取推送的设备token。FCM.getFCMToken().then((token)=>{alert('FCMToken:'+token);console.log(token);});问题是,我在iPhone应用程序中获得了一个token,但是当我在Android中尝试时,该方法没有被调用。我遵循react-native-fcm建议的每一步。谁能帮我解决这个问题? 最佳答案 您似乎忘记从Androidnative端初始化Firebas

java - React-Native DisconnectableInputStream java异常

在新的React-Native项目中,我想在Android设备上运行默认应用程序,但我有这个Java异常:WARNING:Configuration'compile'isobsoleteandhasbeenreplacedwith'implementation'and'api'.Itwillberemovedattheendof2018.Formoreinformationsee:http://d.android.com/r/tools/update-dependency-configurations.htmlWARNING:ThespecifiedAndroidSDKBuildToo

在渲染后出于某种原因在React Native中发生渲染后发生的componenwillmount

componentDidMount(){constrefi=database.ref("highscores");//PushingsorteddatatohighscoreArray.refi.orderByChild("highscore").limitToLast(3).on("value",function(snapshot){sortedHighscores=[];snapshot.forEach(function(child){sortedHighscores.push({"username":child.val().username,"score":child.val().hig

android - 如何编写一个简单的带有回调的 react-native 原生模块

如何以最简单的方式完成这项工作,我无法将回调发送到react-native,可能我遗漏了一些东西。@ReactMethodpublicvoidtestCallback(Callbackcb){StringsampleText="Javaisfun";inttextLength=sampleText.length();try{cb.invoke(textLength);}catch(Exceptione){cb.invoke("err");}}在react-native方面vargetNativeCallback=require('react-native-native-callback