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

Getting list of available Wifi's on react native(android)

$
0
0

I want to get the available WiFi networks on my react-native android app. I went through a few blog posts and StackOverflow questions, but I am unable to achieve the desired functionality. react-native-android-wifi is an npm package, which is expected to achieve the functionality, but I am getting an error of PermissionsAndroid not defined when trying to execute the code for asking user's permission to enable WiFi. Below is the code,

    try {
          const granted = await PermissionsAndroid.request(
            PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
            {
              'title': 'Wifi networks',
              'message': 'We need your permission in order to find wifi networks'
            }
          )
          if (granted === PermissionsAndroid.RESULTS.GRANTED) {
            console.log("Thank you for your permission! :)");
          } else {
            console.log("You will not able to retrieve wifi available networks list");
          }
        } catch (err) {
          console.warn(err)
        }

Can someone please help me out here and please tell me how can I reach my desired outcome.


Will react native work without Google Services on Huawei phone?

$
0
0

Soon new Huawei phones will stop supporting Google Play and Google Mobile Services.

Huawei is preparing its own ecosystem called HMS https://developer.huawei.com/consumer/en/service/hms/developer.html

Their app store is called "Huawei App Gallery" and has its documentation here: https://developer.huawei.com/consumer/en/doc/30202

They are now sending messages to developers (including me) that encourage them to release an app to their store. They are claiming that they only need an APK file and no changes to the application are needed.

My questions are:

  • Is a react-native app going to work without code changes?
  • Is Firebase SDK going to work?
  • What is the real hidden cost of maintaining an app in another Android ecosystem?

React-Native build in Visual Studio Code unable to connect with remote debugger timeout while connecting to remote debugger in windows

$
0
0

I was building react-native on vscode today and got the same error as the image. I've searched around, but it didn't help much as I only had answers for building in terminal. I want to know the solution when building in vscode.

enter image description here

Thanks for your advice

React Native 0.57.1 Android Duplicate Resources

$
0
0

When running ./android/gradlew assembleRelease I get the following error:

``` * What went wrong: Execution failed for task ':app:mergeReleaseResources'.

[drawable-xhdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png [drawable-xhdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png: Error: Duplicate resources [drawable-xxhdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png [drawable-xxhdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png: Error: Duplicate resources [drawable-hdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png [drawable-hdpi-v4/node_modules_reactnavigation_src_views_assets_backicon] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_trophies_cookoo30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_marilyn_monroe_trophies_cookoo30x.png [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_trophies_cookoo30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_marilyn_monroe_trophies_cookoo30x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_5.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_5.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_coins_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_coins_5.png [drawable-mdpi-v4/app_assets_images_coins_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_coins_5.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_emotions_blinking_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_marilyn_monroe_emotions_blinking_2.png [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_emotions_blinking_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_marilyn_monroe_emotions_blinking_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_4.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_4.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_happy_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_happy_2.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_happy_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_happy_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_unlockablecharacters] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_unlockablecharacters.png [drawable-mdpi-v4/app_assets_images_unlockablecharacters] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_unlockablecharacters.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_6.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_6.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_trophies_cookoo3x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_marilyn_monroe_trophies_cookoo3x.png [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_trophies_cookoo3x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_marilyn_monroe_trophies_cookoo3x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_happy_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_happy_3.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_happy_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_happy_3.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_5.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_5.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_emotions_blinking_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_marilyn_monroe_emotions_blinking_3.png [drawable-mdpi-v4/app_assets_images_characters_marilyn_monroe_emotions_blinking_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_marilyn_monroe_emotions_blinking_3.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_coinsmodal_mostpopularlabel] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_coinsmodal_mostpopularlabel.png [drawable-mdpi-v4/app_assets_images_coinsmodal_mostpopularlabel] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_coinsmodal_mostpopularlabel.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_4.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_4.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_coins_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_coins_4.png [drawable-mdpi-v4/app_assets_images_coins_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_coins_4.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_napoleon_trophies_cookoo30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_napoleon_trophies_cookoo30x.png [drawable-mdpi-v4/app_assets_images_characters_napoleon_trophies_cookoo30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_napoleon_trophies_cookoo30x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_earthbg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_earthbg.png [drawable-mdpi-v4/app_assets_images_earthbg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_earthbg.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_happy_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_emotions_happy_6.png [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_happy_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_emotions_happy_6.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry10x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_trophies_angry10x.png [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry10x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_trophies_angry10x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_trophies_3conversations] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_trophies_3conversations.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_trophies_3conversations] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_trophies_3conversations.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_napoleon_trophies_cookoo10x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_napoleon_trophies_cookoo10x.png [drawable-mdpi-v4/app_assets_images_characters_napoleon_trophies_cookoo10x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_napoleon_trophies_cookoo10x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_angry_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_emotions_angry_2.png [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_angry_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_emotions_angry_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_napoleon_profile] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_napoleon_profile.png [drawable-mdpi-v4/app_assets_images_characters_napoleon_profile] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_napoleon_profile.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_happy_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_emotions_happy_4.png [drawable-mdpi-v4/app_assets_images_characters_einee_emotions_happy_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_emotions_happy_4.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_trophies_angry30x.png [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry30x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_trophies_angry30x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_coins_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_coins_6.png [drawable-mdpi-v4/app_assets_images_coins_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_coins_6.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_6.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_blinking_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_blinking_6.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_bg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_bg.jpg [drawable-mdpi-v4/app_assets_images_characters_einee_bg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_bg.jpg: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_cookoo_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_cookoo_2.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_cookoo_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_cookoo_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_3.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_3.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_4.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_4] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_4.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_angry_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_angry_2.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_angry_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_angry_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_trophies_allconversations1x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_trophies_allconversations1x.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_trophies_allconversations1x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_trophies_allconversations1x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_coinsmodal_coins500] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_coinsmodal_coins500.png [drawable-mdpi-v4/app_assets_images_coinsmodal_coins500] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_coinsmodal_coins500.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_angry_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_angry_3.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_angry_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_angry_3.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_5.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_happy_5] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_happy_5.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_2.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_2] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_blinking_2.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_cookoo_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_cookoo_3.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_emotions_cookoo_3] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_emotions_cookoo_3.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry100x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_einee_trophies_angry100x.png [drawable-mdpi-v4/app_assets_images_characters_einee_trophies_angry100x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_einee_trophies_angry100x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_donald_trump_bg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_donald_trump_bg.jpg [drawable-mdpi-v4/app_assets_images_characters_donald_trump_bg] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_donald_trump_bg.jpg: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_cleopatra_trophies_allconversations3x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_cleopatra_trophies_allconversations3x.png [drawable-mdpi-v4/app_assets_images_characters_cleopatra_trophies_allconversations3x] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_cleopatra_trophies_allconversations3x.png: Error: Duplicate resources [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/src/main/res/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_6.png [drawable-mdpi-v4/app_assets_images_characters_leonardo_da_vinci_emotions_angry_6] /Users/Ilyakar/Documents/Business/Development/My_Projects/new/Einee/App/android/app/build/generated/res/react/release/drawable-mdpi/app_assets_images_characters_leonardo_da_vinci_emotions_angry_6.png: Error: Duplicate resources ```

I already tried the following from the answers I found on React Native Duplicate resources with zero success:

Attempt #1:

"Deleting the drawables with rm -rf android/app/src/main/res/drawable-* and generating APK on Android Studio worked for me."

Attempt #2:

"rm -rf android/app/src/main/res/drawable-*

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

And compile android again react-native run-android"


Any other ideas?

Custom font not working in React Native

$
0
0

I want to use a font from google fonts in my app. Here is the font.

I have placed the .ttf file in app/fonts.

package.json:

{
    "name": "xxx",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "rnpm": {
        "assets": ["./app/fonts"]
    },
    "jest": {
        "preset": "react-native",
        "moduleNameMapper": {
            "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
            "\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
        }
    },
    "dependencies": {
        "flow-typed": "^2.0.0",
        "immutable": "^3.8.1",
        "react": "~15.4.1",
        "react-native": "0.42.0",
        "react-native-vector-icons": "^4.0.0",
        "react-redux": "^5.0.3",
        "redux": "^3.6.0",
        "redux-immutable": "^4.0.0",
        "redux-observable": "^0.14.1",
        "rxjs": "^5.2.0"
    },
    "devDependencies": {
        "babel-eslint": "^7.1.1",
        "babel-jest": "19.0.0",
        "babel-preset-react-native": "1.9.1",
        "eslint": "^3.17.0",
        "eslint-plugin-flowtype": "^2.30.3",
        "eslint-plugin-jsx": "^0.0.2",
        "eslint-plugin-react": "^6.10.0",
        "eslint-plugin-react-native": "^2.3.1",
        "flow-bin": "^0.42.0",
        "jest": "19.0.2",
        "jest-cli": "^19.0.2",
        "react-test-renderer": "~15.4.1",
        "redux-devtools": "^3.3.2",
        "remote-redux-devtools": "^0.5.7"
    }
}

then ran react-native link.

Then use the font in my app:

import { View, Text } from 'react-native'
import React from 'react'
import Width from '../width/Width'
import Shape from '../shape/Shape'
import Height from '../height/Height'
import Thickness from '../thickness/Thickness'

export const Volcalc = () => (
  <View style={styles.container}>
    <Text style={styles.text}>SHAPE</Text>
    <Shape />
    <Text style={styles.text}>HEIGHT</Text>
    <Height />
    <Text style={styles.text}>WIDTH</Text>
    <Width />
    <Text style={styles.text}>THICKNESS</Text>
    <Thickness />
  </View>
)

const $mainColor = '#00d1b2'
const styles = {
  container: {
    flex: 1,
    padding: 20,
    backgroundColor: $mainColor
  },
  text: {
    textAlign: 'center',
    color: 'rgba(255, 255, 255, 0.9)',
    fontSize: 15,
    fontFamily: 'Orbitron'
  }
}

In android it doesn't show the new font but has no error. In ios it has error:

Unrecognised font family "Orbitron"

What am I doing wrong?

How do I find out the EXACT value to place in fontFamily: 'xxx'?

Update button is not showing for latest uploaded build on play store

$
0
0

When I make a release build using sh ./gradlew assembleRelease, that is working perfectly on the devices but when I make a .aab file for Play Store, using the command sh ./gradlew bundleRelease and after installing the build from play store, the app is crashing. and also play store is not showing UPDATE option for the latest uploaded build. Here is my packagae.json

"react": "16.9.0",
"react-native": "0.61.4"

ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

$
0
0

When I run

npx react-native run-android --variant=release 

in RN 0.61.3 and I receive this error message.

ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

The build works fine when debugging without the release variant.

Check always location services are enabled or not in React Native (iOS and Android both)

$
0
0

I am working on react native application. There I have to fetch user locations like multiple if user moves/navigates from one place to other. This is working fine, but, If user disables location permission after some time like user goes to settings there disabled permission, I have to show some button like enable location and again Once user tap on that button It should ask to Request Permission for location.

But, If user first time gives permission and later in some time if he disables permission, The popup for Request permission not showing popup in Android on tap of button.

I am using following library to fetch user location details.

import Geolocation from 'react-native-geolocation-service';

// button on click method following
  enableLocationHandler = () => {
    if (Platform.OS === 'android') {
      this.requestLocationPermissions();
    } else {
      Linking.openURL('app-settings:');
      this.getLatitudeLongitude();
    }
  }



requestLocationPermissions = async () => {
    if (Platform.OS === 'android') {
        this.getLatitudeLongitude();
    } else {
      Geolocation.requestAuthorization();
      this.getLatitudeLongitude();
    }
  }



 getLatitudeLongitude() {
    Geolocation.getCurrentPosition((position) => {
      const initialPosition = JSON.stringify(position);
    },
      (error) => {
        if (error.code === 1) {
          this.setState({ errorMessage: 'Location permission is denied', isLoading: false });
          Geolocation.clearWatch(this.watchID);
        }
      },
      { enableHighAccuracy: true, distanceFilter: 100, timeout: 20000, maximumAge: 1000 }
    );
    this.watchID = Geolocation.watchPosition((position) => {
      // this.showLoader();
      // console.log('position', position);
    });
  }

Any suggestions?


Expo run on android emulator using windows 10

$
0
0

Can I run android emulator without an android phone? I have installed android studio and I've already installed android virtual device. However, when I try to run it, it gives an error like this :

Couldn't start project on Android: Error running adb: No Android device found. Please connect a device and follow the instructions here to enable USB debugging: https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory.

I just want to see the emulator in my pc without usb. I have an iPhone but it just shows up in my phone not in my pc using expo scan barcode. I don't want to do that because in my opinion it's not comfortable for debugging etc. I am using windows in my pc so I can't use iOS for emulator.

how to run expo android emulator on windows?

Can't find variable DeviceEventEmitter

How to set canOverrideExistingModule=true in React Native for Android Apps?

$
0
0

I built an android app using React Native, it got built successfully but when I run the app in my Android Virtual Device it shows up a full red screen with the following error:

enter image description here

I have not done native app development ever before neither do I have any knowledge of Java so I have no idea what this error means and how to fix this.

Application profiling / performance testing

$
0
0

(Note: I want to test it on android)

Hi,

I have an application in react native and a similar application made with flutter. I want to profile / test it and see cpu usage, check when they drop frames, etc.

I know that applications in debugmode are worse in performance. So I thought I have to test these two applications in release mode, because I dont know how much debugmode hold these applications back. But from my understanding android profiling does not work in release mode (don't know about systrace, still have some problems with it).

So my question, how do I compare these 2 apps? Is there a way to do with release builds? Or should I test and compare it with a debug build?

[Edit] I read that flutter has a profile build which builds closely to a release build, is running in debugmode and turning off dev mode in react-native about the same?

React Native: error package android.support.annotation does not exist

$
0
0

The error is thrown by

Task :react-native-camera:compileGeneralReleaseJavaWithJavac FAILED

The errors are slightly different but all have that caret pointing to a package that doesn't exist. Around 100 more exist after it that are very similar: enter image description hereenter image description here

I had a RN v0.57 project that needs to be updated in order to go on the play store and after trying to upgrade directly I started seeing errors that google had never seen before so I opted instead to make a new project and port over my src folder and relevant package.json data.

Figured it might take me one week to fix all the errors that way instead of the month I'd expect chasing errors introduced by the upgrade, based on past experience. I've fixed about a dozen earlier bugs before getting stuck on this one so I can't be certain the fixes there didn't introduce this one but thinking like that will get you no progress at all so here I find myself.

I have read a little bit about androidx either being related to this or a possible fix but the last thing I want to do is start introducing new things that can go wrong. The code base was fine and worked in 0.57, I just want to upgrade it to the latest, get it up on the store, and never look at react native again.

This is my package.json:

{
  "name": "(Projectname)",
  "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": {
    "@babel/runtime": "^7.1.2",
    "@react-native-community/cli-platform-android": "^2.9.0",
    "@svgr/core": "^4.2.0",
    "axios": "^0.18.0",
    "date-fns": "^1.30.1",
    "link": "^0.1.5",
    "moment": "^2.24.0",
    "pod-installer": "0.0.0",
    "qs": "^6.5.2",
    "react": "16.9.0",
    "react-moment": "^0.8.4",
    "react-native": "0.61.4",
    "react-native-action-picker": "^1.0.2",
    "react-native-action-sheet": "^2.2.0",
    "react-native-android-log": "^1.1.0",
    "react-native-button": "^2.3.0",
    "react-native-cached-image": "^1.4.3",
    "react-native-calendar-picker": "^6.0.0",
    "react-native-camera": "^2.11.0",
    "react-native-communications": "^2.2.1",
    "react-native-date-picker": "^2.3.0",
    "react-native-document-picker": "^2.1.0",
    "react-native-fetch-blob": "^0.10.8",
    "react-native-fit-image": "^1.5.4",
    "react-native-fontawesome": "^6.0.1",
    "react-native-fs": "^2.13.2",
    "react-native-gesture-handler": "^1.0.17",
    "react-native-image-crop-picker": "^0.22.0",
    "react-native-lazyload-deux": "^2.0.4",
    "react-native-photo-editor": "^1.0.0",
    "react-native-responsive-grid": "^0.41.992",
    "react-native-router-flux": "^4.0.0-beta.31",
    "react-native-simple-toast": "0.0.8",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^9.3.7",
    "react-native-tab-view": "0.0.74",
    "react-native-web-swiper": "^1.15.1",
    "react-navigation": "^3.3.0",
    "react-navigation-stack": "^1.0.10",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "redux-thunk": "^2.3.0",
    "semver": "^6.0.0",
    "uuid": "^3.3.2"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "babel-core": "^7.0.0-bridge.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.47.0",
    "react-native-svg-transformer": "^0.12.1",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./src/fonts"
    ]
  }
}

My Android\app\build.gradle:

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.projectname"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        missingDimensionStrategy 'react-native-camera', 'general' (this was a fix I found and tried but hasn't helped)
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }

        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.google.android.gms:play-services-gcm:12.+" 
    implementation 'com.android.support:appcompat-v7:28.0.0'
    androidTestImplementation "com.android.support:support-annotations:28.0.0"

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

And my Android\build.gradle, anything related to google services I added trying to fix this bug but it hasn't helped:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        googlePlayServicesVersion = "16.+"
        firebaseVersion = "17.3.4"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.2")
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support'&& !details.requested.name.contains('multidex') ) {
                    details.useVersion "26.+"
                }
                if (details.requested.group == 'com.google.android.gms'&& !details.requested.name.contains('multidex') && (
                    !details.requested.name.contains('play-services-stats') ||
                    !details.requested.name.contains('play-services-vision-image-label') ||
                    !details.requested.name.contains('play-services-clearcut') ||
                    !details.requested.name.contains('play-services-flags') ||
                    !details.requested.name.contains('play-services-phenotype')
                    )) {
                    details.useVersion "12.+"
                }
                if (details.requested.group == 'com.google.android.gms'&& !details.requested.name.contains('multidex') && (
                    details.requested.name.contains('play-services-stats') ||
                    details.requested.name.contains('play-services-vision-image-label') ||
                    details.requested.name.contains('play-services-clearcut') ||
                    details.requested.name.contains('play-services-flags') ||
                    details.requested.name.contains('play-services-phenotype')
                    )) {
                    details.useVersion "+"
                }
                if (details.requested.group == 'com.google.firebase'&& !details.requested.name.contains('multidex') && details.requested.name.contains('firebase-messaging')) {
                    details.useVersion "12.+"
                }
            }
        }
    }
}

ext {
    googlePlayServicesVersion = "+" // default: "+"
    firebaseVersion = "+" // default: "+"
    // Other settings
    compileSdkVersion = 28 // default: 23
    buildToolsVersion = "28.0.3" // default: "23.0.1"
    targetSdkVersion = 28 // default: 23
    supportLibVersion = "28.0.0"
}

Any help or advice for this would be greatly appreciated. The end goal is getting my working RN v0.57 app onto the store and I am trying to port my app into a new init'd RN project in order to do that, so if you know an easier way to do that I would gladly go own that path. As far as I can tell there's no quick 'patch' I can apply to 0.57 to make it acceptable to the Play Store, and upgrading directly from 0.57 I believe will be much much more difficult given the problems I've experience with any version changes in RN in the past.

Expo react native app restarts on modal open

$
0
0

I'm using Expo SDK 35

App works fine on iOS (and previously worked fine on android). Now, whenever I hit a TouchableOpacity that opens a modal (react-native-modal) the app restarts. The TouchableOpacity does wrap an animated View. Sentry doesn't catch anything, but device logs have a few errors:

W/unknown:ReactNative(11782): Calling JS function after bridge has been destroyed: RCTDeviceEventEmitter.emit(["appStateDidChange",{"app_state":"background"}])
E/unknown:ReactNative(11782): Tried to remove non-existent frame callback
E/GraphResponse(11782): {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api}

I'm at a total loss here -- some other modals work totally fine and there are no problems on iOS so it doesn't seem like it's an issue with the modal content. And i don't call (or even reference) the graph api anywhere. Has anyone seen this? Sample code below

<TouchableOpacity
   onPress={() => {
     this.toggleView();
     this._openModal({ id: "profile", isOpen: true });
   }}>
    <Text>Hello World</Text>     
</TouchableOpacity>
  toggleView = () => {
    Animated.timing(this.mode, {
      toValue: this.mode._value === 0 ? 1 : 0,
      duration: 1000
    }).start();
    this.setState({ profileOpen: !this.state.profileOpen });
  };

_openModal isn't the issue here, it's working everywhere else in a pretty large codebase and has been extensively tested.

React Native Android runs in dev but not with release

$
0
0

I get these logs and don't understand what it is I need to do. The app has worked for months testing, now I am finally ready to release and it crashes immediately upon opening! I do not understand these logs but maybe someone can see something I can't? I ran react-native run-android --variant=release then I ran this adb logcat "*:E", then I open the app and this is what I get...

11-08 15:56:03.535 29663 29663 E com.myapp: Not starting debugger since process cannot load the jdwp agent.
11-08 15:56:03.584   549  3978 E msm8916_platform: platform_check_backends_match: Invalid snd_device =
11-08 15:56:03.586  1075  1134 E PRM_CONFIG_Parser: get_custom_config not found
11-08 15:56:03.592   549  3978 E ACDB-LOADER: Error: ACDB_CMD_GET_AFE_COMMON_TABLE_SIZE Returned = -19
11-08 15:56:03.729  1075  1134 E PRM_CONFIG_Parser: get_custom_config not found
11-08 15:56:04.183 29663 29691 E AndroidRuntime: FATAL EXCEPTION: create_react_context
11-08 15:56:04.183 29663 29691 E AndroidRuntime: Process: com.myapp, PID: 29663
11-08 15:56:04.183 29663 29691 E AndroidRuntime: java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:218)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:31)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:247)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1152)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:123)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:943)
11-08 15:56:04.183 29663 29691 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:764)
11-08 15:56:04.259  1075  1134 E PRM_CONFIG_Parser: get_custom_config not found
11-08 15:56:04.652  1893  2092 E InputDispatcher: channel 'e1bed86 com.myapp/com.myapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
11-08 15:56:04.714 12294 12356 E chromium: [ERROR:aw_gl_functor.cc(102)] Received unexpected kModeProcessNoContext
11-08 15:56:04.717 12294 12356 E chromium: [ERROR:aw_gl_functor.cc(102)] Received unexpected kModeProcessNoContext
11-08 15:56:07.734  1893  2396 E TaskPersister: File error accessing recents directory (directory doesn't exist?).

Expo React Native - Emulator Debug menu shortcut suddenly stopped working on Windows

$
0
0

I am developing React Native App using Expo (not ejected) and Android Studio official AVD.

I am on Windows.

There is shortcut CTRL-M what opens Expo's (React Native's ??) debug menu for app inside emulator.

It was working for many days but today it suddenly stopped working...

ADB command still works...

Any ideas what should be bad? Expo or AVD problem?

React Native android doesn't have utf8

$
0
0

this is my first day on React Native, I try to make an android application.

This is impossible for me to use some extra caractere like 'é', 'à', 'ç'...

I think this is a problem with utf-8 but I didn't find anything on internet

enter image description here

Any solution?

Thanks.

Gradle is Unable to find external library used in a react native-libray I created

$
0
0

I created a react native library that internally used another android library com.github.okraHQ:okra-android-sdk:0.3-alpha (a jitpack library), when I imported this library in my react native library > android > gradle it works fine. Note: this react-native-library works as a wrapper for com.github.okraHQ:okra-android-sdk:0.3-alpha. A problem occurs when I use the react-native library (wrapper library) in another project, I am met with the error below:

     Could not find com.github.okraHQ:okra-android-sdk:0.3-alpha.
  Searched in the following locations:
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/google/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/google/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/android/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      file:/C:/Users/Java/AppData/Local/Android/Sdk/extras/android/m2repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      file:/C:/Users/Java/.m2/repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      file:/C:/Users/Java/.m2/repository/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      https://dl.google.com/dl/android/maven2/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      https://dl.google.com/dl/android/maven2/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      https://jcenter.bintray.com/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      https://jcenter.bintray.com/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
      file:/C:/Users/Java/Documents/CodeHub/ReactNative/original/node_modules/react-native/android/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.pom
      file:/C:/Users/Java/Documents/CodeHub/ReactNative/original/node_modules/react-native/android/com/github/okraHQ/okra-android-sdk/0.3-alpha/okra-android-sdk-0.3-alpha.jar
  Required by:
      project :app > project :react-native-react-native-okra

From my understanding of this error, it seems like the Gradle is searching for this library in my local folder, jcenter and dl.google.com. but since it is hosted in jitpack there is no way in can be the ones listed before. Please, any suggestions on how I can solve this issue?

Writing unit test for react-native native android methods

$
0
0

I'm building react-native app which has some native android modules in it.
In MainApplication.java,

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new VectorIconsPackage(),
        new MyCustomPackage()
    );
  }

In my MyCustomPackage,

public class MyCustomPackage implements ReactPackage {

  @Override
  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
    return Collections.emptyList();
  }

  @Override
  public List<NativeModule> createNativeModules(
                              ReactApplicationContext reactContext) {
    List<NativeModule> modules = new ArrayList<>();

    modules.add(new MyCustomModule(reactContext));

    return modules;
  }

}

I have few other modules but this is an example. The all functions works well. Now I want to write unit test to methods which are in the MyCustomModule java class. I try to use Robolectric framework but don't know how it's working with react native. Is there any other tool for that? Can anyone give me some example or guide in writing unit test for react-native native android code?

android and ios app subscription checking in react native

$
0
0

I'm creating app that is only available on subscription, no free or trial version. In react native, how do I check if the user has a valid active subscription? Is there any api I need to call?

On the app load or login time, I want to check if the user still has valid subscription and if not just not let the user to login into app.

Another question I have is do I even need to do this? Does android or ios automatically uninstall or restrict access to app if the subscription is expired?

Viewing all 28480 articles
Browse latest View live


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