Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 28476 articles
Browse latest View live

How to fix react native video player visibility, when controls and sound are working?

$
0
0
     *// video get from this*       const SampleVideo = require('../samplevideos/VID_20190811_172946.mp4');     *// this is my app.js code*<View style={{ flex: 1 }}><Video style={{ flex: 1 }} controls={true} source={SampleVideo}                onPress={() => this.togglePaused(this.paused)}                ref={(ref) => {                    // this._player = ref                }}></Video></View>

I am able to hear the sound of the video but the player itself is not visible, controls for the video is visible.

I tried many things to fix it but unable to find the solution.

Here is how it looks:

Here


Android app crashes on release build but works in debug build - React-Native

$
0
0

i know this is a common problem but the error i am seeing is different here's the error

06-13 15:37:51.081  1690  3926 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.lawyr/.MainActivity bnds=[849,682][1056,960] (has extras)} from uid 10020 on display 006-13 15:37:51.137  1690  1782 I ActivityManager: Start proc 13071:com.lawyr/u0a88 for activity com.lawyr/.MainActivity06-13 15:37:51.285 13071 13071 D SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.lawyr-1/lib/x86 flags = 0]06-13 15:37:51.290 13071 13071 D SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.lawyr/lib-main flags = 1]06-13 15:37:51.293 13071 13071 D SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.lawyr-1/lib/x86 flags = 0]06-13 15:37:51.294 13071 13071 D SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.lawyr/lib-main flags = 1]06-13 15:37:51.297 13071 13071 V fb-UnpackingSoSource: locked dso store /data/user/0/com.lawyr/lib-main06-13 15:37:51.299 13071 13071 I fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.lawyr/lib-main06-13 15:37:51.299 13071 13071 V fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.lawyr/lib-main06-13 15:37:51.337 13071 13071 E EmbeddedLoader:    at com.lawyr.MainApplication.onCreate(MainApplication.java:86)06-13 15:37:51.338 13071 13071 E AndroidRuntime: Process: com.lawyr, PID: 1307106-13 15:37:51.338 13071 13071 E AndroidRuntime:    at com.lawyr.MainApplication.onCreate(MainApplication.java:86)06-13 15:37:51.340  1690  2045 W ActivityManager:   Force finishing activity com.lawyr/.MainActivity06-13 15:37:51.850  1690  1703 W ActivityManager: Activity pause timeout for ActivityRecord{30dba1e u0 com.lawyr/.MainActivity t51 f}06-13 15:37:51.853  1690  1703 I WindowManager: Failed to capture screenshot of Token{cc192ff ActivityRecord{30dba1e u0 com.lawyr/.MainActivity t51 f}} appWin=Window{ad21564 u0 Starting com.lawyr} drawState=4

i did build release and the app crashes on launch i tried build it with debug and run without error.

In my react-native application I'm facing an error of > Task :app:mergeDexDebug FAILED

$
0
0

when I install @react-native-firebase/database, @react-native-firebase/app , @react-native-firebase/auth and @react-native-firebase/storage altogether. Unistalling either one of them solves the issue but I don't understand what's going wrong otherwise as I have to use those packages. The package.json is as follows :

{"name": "ImageExample","version": "0.0.1","private": true,"scripts": {"android": "react-native run-android","ios": "react-native run-ios","start": "react-native start","test": "jest","lint": "eslint ." },"dependencies": {"@react-native-community/masked-view": "^0.1.10","@react-native-firebase/app": "^7.2.1","@react-native-firebase/database": "^7.2.2","@react-native-firebase/storage": "^7.1.4","react": "16.11.0","react-native": "0.62.2","react-native-axios": "^0.17.1","react-native-gesture-handler": "^1.6.1","react-native-image-picker": "^2.3.1","react-native-paper": "^3.10.1","react-native-progress": "^4.1.2","react-native-reanimated": "^1.9.0","react-native-safe-area-context": "^3.0.3","react-native-screens": "^2.8.0","react-navigation": "^4.3.9","react-navigation-stack": "^2.7.0","react-navigation-tabs": "^2.8.13" },"devDependencies": {"@babel/core": "7.10.2","@babel/runtime": "7.10.2","@react-native-community/eslint-config": "0.0.5","babel-jest": "24.9.0","eslint": "6.8.0","jest": "24.9.0","metro-react-native-babel-preset": "0.58.0","react-test-renderer": "16.11.0" },"jest": {"preset": "react-native" }}

Task :app:installDebug FAILED in React native

$
0
0

After i build apk and set, enableProguardInReleaseBuilds and enableSeparateBuildPerCPUArchitecture to TRUE. I always failed to build my React native project.

Here is the message on the terminal.

Task :app:stripDebugDebugSymbols UP-TO-DATE Compatible side by side NDK version was not found.

Task :app:installDebug 10:19:56 V/ddms: execute: running am get-config 10:19:56 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1 10:19:56 V/ddms: execute: returning Installing APK 'app-debug.apk' on 'Pixel_2_API_28(AVD) - 9' for app:debug 10:19:56 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554' 10:19:56 D/Device: Uploading file onto device 'emulator-5554' 10:19:56 D/ddms: Reading file permision of /Users/ahroidlife/Documents/react-native/lab/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r-- 10:19:56 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk" 10:19:57 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1

Task :app:installDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings187 actionable tasks: 3 executed, 184 up-to-dateUnable to install /Users/ahroidlife/Documents/react-native/lab/android/app/build/outputs/apk/debug/app-debug.apk

Here is my screenshot :1. Screenshot2. Screenshot3. Screenshot

Which is the best way to communicate from app to app in single device?

$
0
0

My idea is create Report Viewer application for both Android and IOS, (could be good on ReactNative also)

  1. BaseApp: open ReportApp via URL_Scheme to register BaseApp URL_Scheme
  2. ReportApp: send request to get json_spec to BaseApp
  3. ReportApp: read api from spec, and send request back to BaseApp get and display data (table, chart,...)

I find some technologies, that I think it could solve my problem:

  1. Inter Process Communication
  2. Android Intent
  3. Android Content Provider
  4. Or, May I use custom REST server on my app

Anyone can give me the best way. Could you please give some docs or resources. Thank so much!

is it possible to have React Native and Android Views in Same activity/android fragment layout?

$
0
0

Suppose I have my page that is completely written in React Native that has views linearly added. For example A - B- c -D. Now I need to add view E that is actually a Android Fragment(abc.xml layout file). So my view Hierachy should be A(RN) - B(RN) - E(Android fragment) - C(RN) - D(RN). is this possible?

React-Native-Webrtc duplicate images stream

$
0
0

I'm tring to use https://github.com/react-native-webrtc/react-native-webrtc in my project. I started by using the example in the documentation and the result is that the front cam "appear" but is seems the image is duplicated multiples times.

The code is pretty much the same as the doc except somme modifications to show the RTCView:

  let isFront = true;  useEffect(() => {    const configuration = {iceServers: [{url: 'stun:stun.l.google.com:19302'}]};    const pc = new RTCPeerConnection(configuration);    mediaDevices.enumerateDevices().then((sourceInfos) => {      let videoSourceId;      console.log(sourceInfos);      for (let i = 0; i < sourceInfos.length; i++) {        const sourceInfo = sourceInfos[i];        if (          sourceInfo.kind == 'videoinput'&&          sourceInfo.facing == (isFront ? 'front' : 'environment')        ) {          videoSourceId = sourceInfo.deviceId;        }      }      mediaDevices        .getUserMedia({          audio: true,          video: {            mandatory: {              minWidth: 500, // Provide your own width, height and frame rate here              minHeight: 300,            },          },        })        .then((stream) => {          setStream(stream);          console.log('set stream');          // Got stream!        })        .catch((error) => {          console.log('error', error);          // Log error        });    });    pc.createOffer().then((desc) => {      pc.setLocalDescription(desc).then(() => {        // Send pc.localDescription to peer      });    });    pc.onicecandidate = function (event) {      // send event.candidate to peer    };  }, [isFront]);   const styles = {    wrapper: {      flex: 1,      justifyContent: 'flex-end',    },    buttonWrapper: {      width: '100%',      height: '20%',      alignItems: 'center',      justifyContent: 'center',    },  } as React.CSSProperties;  return (<View style={styles.wrapper}><View style={{width: '100%', height: '70%', backgroundColor: 'red'}}>        {stream != null ? (<RTCView            style={{flex: 1, height: 150, margin: 10}}            streamURL={stream.toURL()}          />        ) : (<Text>No RTC</Text>        )}</View><View style={styles.buttonWrapper}><NitaButton          title="Contact Help"          onPress={() => navigation.navigate('WaitingRoom')}        /></View></View>  );

I can't seem to find similar problem online. Am I missing something? Thanks!

I'm using a huawei P30 pro, react-native: 0.62.2 and react-native-webrtc: 1.75.3

Edit

Similar problem running with the emulator.

enter image description here

Edit

I fixed it by changing video: true

Fastlane & React-Native: Google Api Error: Invalid request - Access Not Configured

$
0
0

What causes the below error when using Fastlane and React-Native after running this :

fastlane beta

[22:36:39]: Google Api Error: Invalid request - Access Not Configured. Google Play Developer API has not been used in project xxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/overview?project=xxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.+------+----------------------+-------------+|             fastlane summary              |+------+----------------------+-------------+| Step | Action               | Time (in s) |+------+----------------------+-------------+| 1    | default_platform     | 0           || 2    | bundleRelease        | 18          || 💥   | upload_to_play_store | 1           |+------+----------------------+-------------+[22:36:39]: fastlane finished with errors[!] Google Api Error: Invalid request - Access Not Configured. Google Play Developer API has not been used in project xxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/overview?project=xxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

This is how my Fastfile:

platform :android do  desc "Runs all the tests"  lane :test do    gradle(task: "test")  end  lane :beta do  # Adjust the `build_type` and `flavor` params as needed to build the right APK for your setup  gradle(    task: 'bundle',    build_type: 'Release'  )  upload_to_play_store(track: 'beta',  skip_upload_apk: true,     aab: 'app/build/outputs/bundle/release/app-release.aab'  )  end  desc "Deploy a new version to the Google Play"  lane :deploy do    gradle(task: "clean assembleRelease")    upload_to_play_store  endend

Have enabled Google Play Developer API too for the project.

Anyone here who can quickly help me solve this issue? Thanks in advance!


React Native: Crop image on Android

$
0
0

The following function works on iOS, but doesn't work on Android. I want to achieve the same result on both platforms.

Based on this official documentation, the reason is missing ImageStore in react-native package for Android.

import {  ImageEditor,  ImageStore} from 'react-native';

What would be an alternative way to crop images (as square) in react-native for Android?

cropImage(base64ImageData) {    return new Promise((resolve, reject)=>{      ImageStore.addImageFromBase64(        base64ImageData,        (photoURI)=>{          ImageEditor.cropImage(            photoURI,            {offset:{x:0,y:(1920-1080)/2},size:{width:1080, height:1080}},            (croppedURI)=>{              ImageStore.getBase64ForTag(                croppedURI,                (base64CroppedData)=>{                  ImageStore.removeImageForTag(croppedURI);                  resolve(base64CroppedData);                },                (err)=>{                  reject(err);                }              );              ImageStore.removeImageForTag(photoURI);            },            (err)=>{              reject(err);            }          );        },        (err)=>{          reject(err);        }      );    });  }

Update:

There is a project https://github.com/seancunningham/react-native-image-store-ext (last commit Oct 28, 2016), but it only implements:

  • Boolean removeImageForTag(String file_uri)

The rest is missing:

  • static addImageFromBase64(base64ImageData, success, failure)

My preliminary solution:

  private static final String IMAGE_STORAGE_URL_SCHEME = "rct-image-store";  @ReactMethod  public void addImageFromBase64(String base64_image_data, Callback successCallback, Callback failureCallback){    String imageStorageDir = this.reactContext.getApplicationContext().getFilesDir()+"/"+IMAGE_STORAGE_URL_SCHEME+"/";    byte[] buffer = new byte[BUFFER_SIZE];    String file_uri = imageStorageDir+"1";    try {      File f = new File(imageStorageDir);      if(!f.exists()) {        f.mkdir();      }      FileOutputStream fos = new FileOutputStream(file_uri, false);      byte[] decodedImage = Base64.decode(base64_image_data, Base64.DEFAULT);      fos.write(decodedImage);      fos.close();      successCallback.invoke("file://"+file_uri);    } catch (IOException ioe) {      failureCallback.invoke("Failed to add image from base64String"+ioe.getMessage());    } catch (Exception e) {      failureCallback.invoke("Failed to add image from base64String"+e.getMessage());    }  }
  • static getBase64ForTag(uri, success, failure)

Implemented in this fileImageStorageManager.java

  • static hasImageForTag(uri, callback)

React Native + Android Studio: ERROR: Each module must have a unique path

$
0
0

I have a react native project that I recently ejected from Expo. However, when I try to run the app through Android studio, it keeps showing me this error:

ERROR: The modules ['@react-native-community_cameraroll', 'react-native-community_cameraroll'] point to the same directory in the file system.Each module must have a unique path.

When I look inside my app.iml file, I see this:

<orderEntry type="module" module-name="@react-native-community_cameraroll" /><orderEntry type="module" module-name="react-native-community_cameraroll" />

I tried removing one of those lines but when I press "Try Again" on Android studio, it re-adds the line I deleted and then fails again.

How can I find out which library this is coming from? I don't know how to debug which line to delete.

Here's my package.json file:

{"scripts": {"start": "react-native start","android": "react-native run-android","ios": "react-native run-ios","web": "expo start --web"  },"dependencies": {"@apollo/client": "^3.0.0-beta.41","@bugsnag/expo": "^6.5.0","@eva-design/eva": "^2.0.0-alpha.1","@expo/react-native-action-sheet": "^3.6.0","@react-native-community/async-storage": "^1.5.1","@react-native-community/cameraroll": "^1.7.2","@react-native-community/datetimepicker": "2.2.2","@react-native-community/masked-view": "0.1.6","@react-native-community/netinfo": "^5.7.1","@react-native-firebase/admob": "^6.4.0","@react-native-firebase/analytics": "^6.4.0","@react-native-firebase/app": "^6.4.0","@react-navigation/bottom-tabs": "^5.2.4","@react-navigation/compat": "^5.1.6","@react-navigation/native": "^5.1.3","@react-navigation/stack": "^5.2.8","@ui-kitten/components": "^5.0.0-alpha.1","@ui-kitten/eva-icons": "^5.0.0-alpha.1","apollo-cache-inmemory": "^1.6.5","apollo-client": "^2.6.8","apollo-link": "^1.2.13","apollo-link-context": "^1.0.19","apollo-link-error": "^1.1.12","apollo-upload-client": "^12.1.0","axios": "^0.19.0","bugsnag-react-native": "^2.23.7","expo": "^37.0.0","expo-blur": "~8.1.0","expo-camera": "~8.2.0","expo-constants": "~9.0.0","expo-file-system": "~8.1.0","expo-image-picker": "~8.1.0","expo-localization": "~8.1.0","expo-media-library": "~8.1.0","expo-notifications": "^0.1.1","expo-permissions": "~8.1.0","expo-updates": "^0.2.2","final-form": "^4.18.2","graphql": "^14.6.0","graphql-tag": "^2.10.1","i18n-js": "^3.3.0","lodash": "^4.17.15","lottie-ios": "^3.1.3","lottie-react-native": "^3.3.2","moment": "^2.24.0","moment-range": "^4.0.2","react": "~16.9.0","react-apollo": "^3.1.3","react-dom": "16.9.0","react-final-form": "^6.3.0","react-native": "~0.61.5","react-native-appearance": "~0.3.3","react-native-calendars": "^1.259.0","react-native-circular-progress": "^1.3.0","react-native-collapsible": "^1.5.1","react-native-drag-sort": "^2.1.1","react-native-elements": "^1.2.7","react-native-fast-image": "^8.1.5","react-native-gesture-handler": "~1.6.0","react-native-htmlview": "^0.15.0","react-native-iap": "^3.5.9","react-native-image-zoom-viewer": "^2.2.27","react-native-modal-datetime-picker": "^8.1.1","react-native-reanimated": "~1.7.0","react-native-safe-area-context": "0.7.3","react-native-screens": "~2.2.0","react-native-star-rating": "^1.1.0","react-native-svg": "^11.0.1","react-native-swiper": "^1.6.0-nightly.5","react-native-ui-kitten": "^4.3.2","react-native-unimodules": "^0.9.0","react-native-web": "^0.11.7","react-navigation": "^4.3.4","react-navigation-stack": "^1.9.0","react-navigation-tabs": "^2.5.5","react-redux": "^7.1.0","redux": "^4.0.4","redux-logger": "^3.0.6","redux-persist": "^5.10.0","styled-components": "^4.3.2","victory-native": "^32.0.2"  },"devDependencies": {"@babel/core": "~7.9.0","babel-jest": "~25.2.6","jest": "~25.2.6","react-test-renderer": "~16.9.0","@types/react": "^16.9.11","@types/react-native": "^0.60.22","babel-preset-expo": "^8.1.0","typescript": "^3.8.3"  },"resolutions": {"apollo-client": "2.6.8"  },"private": true}

Expo camera zoom

$
0
0

That's my first time using the Pinch Gesture Handler in React Native... I'm trying to create a zoomable camera using Expo. What i'm doing is:

const handlePinch = (nativeEvent) => {   const { scale, velocity } = nativeEvent;   let newZoom =     velocity > 0       ? zoom + scale * velocity * (Platform.OS === "ios" ? 0.01 : 25)       : zoom -         scale * Math.abs(velocity) * (Platform.OS === "ios" ? 0.02 : 50);   if (newZoom < 0) newZoom = 0;   else if (newZoom > 0.5) newZoom = 0.5;   setZoom(newZoom);};...<ExpoCamera    ...    zoom={zoom}    ...>

Working but not too smoothy... Is there any better way to do this?

How do disabled react native from downloading dependencies from the internet?

$
0
0

I am trying to run react native app on android emulator in computer without internet. The problem is that the first run trying to download the files: "addons_list-1.xml","addons_list-2.xml","addons_list-3.xml"

I want to skip these downloads or copy them from computer with internet but i can't get their location because of they were deleted after the application first run.

Other's side video is not showing in Twilio Video calling in react-native. Calling between Web and android

$
0
0

Using this library for twilio video calling https://github.com/blackuy/react-native-twilio-video-webrtcParticipant view is showing black after connection. Not getting any error. values are coming in _onParticipantAddedVideoTrack. other callbacks are working.

_onParticipantAddedVideoTrack = ({ participant, track }) => {    //console.warn("onParticipantAddedVideoTrack: ", participant, track)    console.log("conference 10 ", participant, track);    this.setState({      videoTracks: new Map([        ...this.state.videoTracks,        [track.trackSid, { participantSid: participant.sid, videoTrackSid: track.trackSid }]      ]),    });    this.setState({      trackSid: track.trackSid, isParticipant: true,      trackIdentifier: { participantSid: participant.sid, videoTrackSid: track.trackSid }    });  }<TwilioVideoParticipantView          style={styles.remoteVideo}          key={this.state.trackSid}          enabled={true}          trackIdentifier={this.state.trackIdentifier}        />

I am stuck with this issue. Any help will always be appreciated. Thanks

React-native app is not running on Android 4.3

$
0
0

My react-native app has following package.json

{"name": "Seller","version": "0.0.1","private": true,"scripts": {"android": "react-native run-android","ios": "react-native run-ios","start": "react-native start","test": "jest","lint": "eslint .","cleanA": "cd android && ./gradlew clean && cd ..","apk": "cd android && ./gradlew assembleRelease && cd .."  },"dependencies": {"@react-native-community/async-storage": "^1.10.3","@react-native-community/geolocation": "^2.0.2","@react-native-community/masked-view": "0.1.6","@react-native-community/picker": "^1.4.0","@react-native-firebase/app": "^6.7.1","@react-native-firebase/auth": "^6.7.1","@react-native-firebase/messaging": "^6.7.1","@react-navigation/bottom-tabs": "^5.3.3","@react-navigation/drawer": "^5.6.3","@react-navigation/material-top-tabs": "^5.1.14","@react-navigation/native": "^5.2.3","@react-navigation/stack": "^5.2.18","react": "16.11.0","react-native": "0.62.2","react-native-chart-kit": "^5.5.0","react-native-elements": "^2.0.0","react-native-gesture-handler": "~1.6.0","react-native-image-picker": "^2.3.1","react-native-reanimated": "~1.7.0","react-native-safe-area-context": "0.7.3","react-native-screens": "~2.2.0","react-native-svg": "^12.1.0","react-native-tab-view": "^2.14.0","react-native-vector-icons": "^6.6.0","react-redux": "^7.2.0","redux": "^4.0.5","redux-devtools-extension": "^2.13.8","redux-thunk": "^2.3.0"  },"devDependencies": {"@babel/core": "^7.6.2","@babel/runtime": "^7.6.2","@react-native-community/eslint-config": "^0.0.5","babel-jest": "^24.9.0","eslint": "^6.5.1","jest": "^24.9.0","metro-react-native-babel-preset": "^0.58.0","react-test-renderer": "16.11.0"  },"jest": {"preset": "react-native"  }}

It is running fine on Android 5.0 and above. Min SDK version is 16. However, it is not running on Android 4.3

Exception trace is given below:

FATAL EXCEPTION: mainjava.lang.NoClassDefFoundError: org.reactnative.maskedview.RNCMaskedViewPackage    at com.facebook.react.PackageList.getPackages(PackageList.java:87)    at com.khareeddari.seller.MainApplication$1.getPackages(MainApplication.java:27)    at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:77)    at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39)    at com.khareeddari.seller.MainApplication.onCreate(MainApplication.java:48)    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4684)    at android.app.ActivityThread.access$1400(ActivityThread.java:159)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:176)    at android.app.ActivityThread.main(ActivityThread.java:5419)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:525)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)    at dalvik.system.NativeStart.main(Native Method)

I tried to change compileSdkVersion in android/build.gradle. However after that, I am getting compiler in dependent packages as they are not getting compiled with Java 1.6.

What are the steps to resolve this problem?

How to dynamically set react-native image source inside flat list

$
0
0

I'm new to react native i'm trying to populate flat list with images. All the images are stored inside the app. I want to set image source dynamically in every iteration. This is what I tried. Please help me.

<FlatList  data={this.state.listData}  renderItem={({ item }) => {<Image                                                                 source={    (item)=>{     switch(item.TypeX){     case '1':     return require('path 1');     case '2':     return require('path 2')   }}} />  }</FlatList>

Task :react-native-community_masked-view:javaPreCompileDebug FAILED

$
0
0

Some hours ago my code was running perfectly fine on both android and ios. Now, i got some problem only in android. IOS works perfectly fine.

The error I've got :

Task :react-native-community_masked-view:javaPreCompileDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

Note: I am using gradle-6.5-all.zip

My Dependencies in package.json are :

"dependencies": {"@fortawesome/fontawesome-svg-core": "^1.2.28","@fortawesome/free-brands-svg-icons": "^5.13.0","@fortawesome/free-regular-svg-icons": "^5.13.0","@fortawesome/free-solid-svg-icons": "^5.13.0","@fortawesome/react-native-fontawesome": "^0.2.5","@react-native-community/masked-view": "^0.1.10","@react-navigation/native": "^5.5.1","@react-navigation/stack": "^5.5.1","react": "16.11.0","react-native": "0.62.2","react-native-fs": "^2.16.6","react-native-gesture-handler": "^1.6.1","react-native-image-picker": "^2.3.1","react-native-reanimated": "^1.9.0","react-native-safe-area-context": "^3.0.3","react-native-screens": "^2.8.0","react-native-sqlite-storage": "^5.0.0","react-native-svg": "^12.1.0","react-native-vector-icons": "^6.6.0","react-redux": "^7.2.0","redux": "^4.0.5","redux-thunk": "^2.3.0"  }

"react-native run-android" gives an error - Execution failed for task ':app:mergeDebugResources'. I can run the simulator but the app does not launch

$
0
0

I have been searching for solutions for this and I cant seem to find any. Keep in mind, I am new to this and Just want to get my first app started and get more experience with mobile app dev.I have no clue or idea on how to solve this, tried to delete build directory and build again, tried gradlew clean, everything on every other forum. Please helpHere is the whole error after i type : react-native run-android

C:\Windows\System32\tester>react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using"--no-jetifier" flag. Jetifier found 967 file(s) to forward-jetify. Using 8 workers... info Starting JS server... info Launching emulator... info Successfully launched emulator. info Installing the app... Downloadinghttps://services.gradle.org/distributions/gradle-6.5-bin.zip .........10%..........20%..........30%..........40%.........50%..........60%..........70%..........80%.........90%..........100%

Welcome to Gradle 6.5!

Here are the highlights of this release: - Experimental file-system watching - Improved version ordering - New samples

For more details see https://docs.gradle.org/6.5/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

Task :app:mergeDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. Seehttps://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings 17 actionable tasks: 17 executed

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 40s

error Failed to install the app. Make sure you have the Android development environment set up:https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'.

    Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed AAPT: C:\Windows\System32\tester\android\app\build\intermediates\res\merged\debug: error: directory does not exist.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 40s

at makeError (C:\Windows\System32\tester\node_modules\execa\index.js:174:9)at C:\Windows\System32\tester\node_modules\execa\index.js:278:16at processTicksAndRejections (internal/process/task_queues.js:97:5)at async runOnAllDevices (C:\Windows\System32\tester\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)at async Command.handleAction (C:\Windows\System32\tester\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)

React Native - Native Base Footer not change color

$
0
0

Here is the code:

 // Bottom.js<StyleProvider style={getTheme(commonColor)}><Footer><FooterTab><Button active><Icon active name="food" size={24}  /><Text active>Lunch Box</Text></Button><Button><Icon name="coins" size={24} /><Text>Point</Text></Button><Button><Icon name="face" size={24} /><Text>Profile</Text></Button></FooterTab></Footer></StyleProvider>// commonColor.js// FooterfooterHeight: 55,footerDefaultBg: '#ffffff',// FooterTabtabBarTextColor: '#FFF',tabBarTextSize: platform === 'ios' ? 14 : 16,activeTab: platform === 'ios' ? '#007aff' : '#fff',sTabBarActiveTextColor: '#007aff',tabBarActiveTextColor: '#fff',tabActiveBgColor: platform === 'ios' ? '#1569f4' : '#1569f4',

here is the result:Result

I've tried edit FooterTab.js directly but no changed at all.

The only changes that can happen on render is tabActiveBgColor: platform === 'ios' ? '#1569f4' : '#1569f4'. And I don't even know why only this code is working, I not even set any active on FooterTab.

What I expected is when I set active the button and text become white.

Any Solution?

how to trigger a function when react native firebase notification in recieved and app is open in forground

$
0
0

i'm using react native firebase and react navigation and i want to navigate to specific screen when recieving a notification, but when app is open no events is called when pressing notification.

this is how my code looks like, i have made some changes in order to be able navigate. Last Question

this is part of my package.json :

"@react-native-firebase/app": "^6.4.0","@react-native-firebase/messaging": "^6.4.0","@react-navigation/native": "^5.0.6","@react-navigation/stack": "^5.0.6","react": "16.9.0","react-native": "0.61.5",

Amazon Pay Integration with React Native [closed]

$
0
0

I developing a eCommerce app. Which needs to implement different pay gateway integration. The backend of the is wordpress REST API. I have implemented paypal. Now I want to integrate Amazon Pay as the payment gateway but I could not found any sdk of amazon pay for react native. I only found https://www.npmjs.com/package/amazon-pay-react this package, which is built for react and doesn't work on react native.

Can anyone please give me a solution how can I integrate amazon pay with my react native app.

Viewing all 28476 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>