react-native-android

Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

不羁岁月 提交于 2019-12-17 22:26:39
问题 I've setup the environment for react native on Windows. But when I run the command react-native run-android I get the following errors - * What went wrong: A problem occurred configuring project ':app'. > Failed to notify project evaluation listener. > Could not initialize class com.android.sdklib.repository.AndroidSdkHandler How do I fix this? 回答1: I encountered this error while running the following command in macOS ./gradlew assembleRelease --stacktrace and got the exact error posted. I

Linking with android os settings in react native

时光总嘲笑我的痴心妄想 提交于 2019-12-17 19:22:14
问题 I'm trying to link with android os settings page. Going to Phone Dail with Linking is work. Linking.openURL('tel: +959 XXXXXXXX'); Can I use Linking to link with android os settings page like android location settings page? 回答1: Linking.openURL can only open correctly formatted urls. There are no standardized urls for the android settings. You would have to write some native code to do this, and then build a React Native Module to trigger it. Here is some example Android code: public void

How to reduce the size of an expo/react-native app on Android

Deadly 提交于 2019-12-17 17:41:40
问题 I am developing a small dictionary app by using react native with expo. As I am compiling to Apk file. The size goes up to 30mb and after having installed on a device, it goes to 80mb. Is this normal? Are there any ways to reduce the size of the app? Thank you guys. 回答1: expo is for testing the app you should migrate to react-native for production make a new react app " react-native init " Copy the source files over from Expo project Install all dependencies of the Expo project except Expo

Change package name for Android in React Native

不羁的心 提交于 2019-12-17 17:23:45
问题 I used react-native init MyApp to initialise a new React Native app. This created among others an Android project with the package com.myapp . What's the best way to change this package name, for example to: com.mycompany.myapp ? I tried changing it in AndroidManifest.xml but it created other errors, so I'm assuming it's not the way. Any idea? 回答1: I've changed project' subfolder name from: " android/app/src/main/java/MY/APP/ OLD_ID / " to: " android/app/src/main/java/MY/APP/ NEW_ID / " Then

React Native - Device back button handling

拟墨画扇 提交于 2019-12-17 16:06:47
问题 I want to check if there are more than one screens are on stack when device back button is hit. If yes, I want to show previous screen and if no, I want to exit app. I have checked number of examples but those use BackAndroid and Navigator. But both of them are deprecated. BackHandler is replacement for BackAndroid. And I can show previous screen by using props.navigation.goBack(null). But I am unable to find code for finding screen count in stack. I don't want to use deprecated Navigator!

componentWillMount is deprecated and will be removed in the next major version 0.54.0 in React Native

ぐ巨炮叔叔 提交于 2019-12-17 07:23:51
问题 I use the react native latest version of 0.54.0 and Whenever run the apps on iOS there is found warning about deprecate the lifecycle methods. and also please update the components. Warning : componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount. Please update the following components: Container, Text, TouchableOpacity, Transitioner, View I Have also change according

undefined is not a function (evaluating 'babelHelpers.asyncToGenerator') react-native

℡╲_俬逩灬. 提交于 2019-12-14 03:29:09
问题 I've got this error and get stuck. I tried to remove .babelrc file but this doesn't make it work. 回答1: You need to import babel-polyfill as a first thing in your script: import 'babel-polyfill'; 回答2: I had this exact same issue, but I fixed it by adding transform-async-to-generator to my .babelrc file from this babel package babel-plugin-transform-async-to-generator 来源: https://stackoverflow.com/questions/44237944/undefined-is-not-a-function-evaluating-babelhelpers-asynctogenerator-react-n

TouchableOpacity border radius breaks background color on Android - React Native

 ̄綄美尐妖づ 提交于 2019-12-14 03:08:51
问题 I have a button that's styled as a TouchableOpacity. On iOS this button has a white background and round corners, but in Android the background color doesn't get applied when there's a border-radius, it does when I take it out. border-radius also doesn't appear to have any effect regardless of whether there's a background color or not in Android. I know I can use some conditional based on the platform, but I'd like to know if it's possible to have the same between the two platforms with the

How to change JavaScript bundle directory path from assets to internal storage in React Native AAR in Android?

此生再无相见时 提交于 2019-12-14 03:08:25
问题 We are using React Native with our existing application. Due to various reasons, we are downloading a JavaScript bundle from our server and storing it in internal storage. Now we want React Native AAR to refer to our JavaScript bundle from internal storage instead of the assets folder . For this, somewhere we will need to set a JavaScript bundle directory path , that React Native refers to. Please let me know how we can achieve this. Is there some kind of property where this path can be set?

React-native build error: Execution failed for task ':react-native-maps:prepareComAndroidSupportAppcompatV72301Library'. > Could not expand ZIP

可紊 提交于 2019-12-13 17:15:24
问题 I created a new react-native project on a Windows 10 system, installed the react-native-maps package and rnpm link , but when starting the project I get a Build failed error. What is causing this problem? react-native init myapp npm install react-native-maps --save rnpm link react-native run-android Versions react-native-cli: 1.3.0 react-native: 0.39.1 node: v7.2.1 npm: 3.10.10 Error JS server already running. Running C:\Users\y\AppData\Local\Android\Sdk/platform-tools/adb -s emulator-5554