Skip to content

Instantly share code, notes, and snippets.

@KyrosDigital
Last active October 15, 2020 17:22
Show Gist options
  • Save KyrosDigital/67c0c5cd5a37241fec9c3bb7984a152c to your computer and use it in GitHub Desktop.
Save KyrosDigital/67c0c5cd5a37241fec9c3bb7984a152c to your computer and use it in GitHub Desktop.

Here are the best practices for Kyros team

React Native - New Projects

While trying to run the app in release mode on Android, there are potential issue you can run into:

If you see this error: AAPT: error: resource android:attr/colorError not found. follow this post and add this to your android build.gradle file:

subprojects {
    afterEvaluate {
        project ->
            if (project.hasProperty("android")) {
                android {
                    compileSdkVersion = 28
                    buildToolsVersion = "28.0.3"
                }
            }
    }
}

This forces the app to use the specific SDK version for building.

If you see this error: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so result: 0 follow this post and add this line to your app build.gradle file:

implementation 'com.facebook.soloader:soloader:0.9.0+'

This updates the soloader which should solve an issue where JSC-Android wouldn't load (the libhermes error isn't actually correct in this case).

@rabidale
Copy link

Netinfo issues with react-native-meteor:

In node_modules/react-native-meteor/src/Meteor.js, import NetInfo like this:

import NetInfo from '@react-native-community/netinfo';

Then replace lines 92-96 with this:

NetInfo.fetch().then(state => {
      let isConnected = state.isConnected;
      if (isConnected)
        NetInfo.isConnected.addEventListener('connectionChange', isConnected => {
          if (isConnected && Data.ddp.autoReconnect) {
            Data.ddp.connect();
          }
        });
    }).catch(error => {
      console.log(error)
    });

@rabidale
Copy link

If testing a react-native app on a device/simulator using iOS14 or beyond and images are not appearing, follow the tips in this link to edit the react-native node module: facebook/react-native#29279 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment