React Native Troubleshooting
Troubleshooting common issues with our React Native plugin.
Troubleshooting Steps
Check the below first for common issues with React Native setup.
For Android and/or iOS Platform issues, see:
Try our example project on GitHub.
If stuck, contact support directly by sending an email to [email protected].
For faster assistance, please provide the following:
- Your iZooto App ID (available under Settings > General > Account ID for the iOS property on the panel)
- Details, logs, and screenshots of the issue
- Steps to reproduce
Check Link Step Worked Correctly
We need to ensure that react-native-link
worked correctly (happens automatically by RN 0.60+). Inside of MainApplication.java
, make sure that you are now returning the RNIzooto
package. Other dependencies, such as react-native-navigation
, will often override the default ReactApplication
class, so it is important to make sure you are returning the iZooto package if you've made changes to this class.
Could not determine the dependencies of task ':app:installDebug'
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file.
Open the > android directory and add a file called local.properties
Within local.properties
place your android SDK path. An example is given below:
sdk.dir = /Users/jonizooto/Library/Android/sdk
XCode: ld: framework not found iZooto
Re-install your Pods
Run the below in your iOS
directory:
pod deintegrate
pod install
Make sure this installs the latest native version of the iZooto iOS SDK.
If you are having issues while re-installing your pods, try deleting your PodFile.lock
and re-run.
Modify your Header Search Paths
- Go to your Project Settings and select the
iZootoNotificationServiceExtension
target. - Go to Build Settings and search for Header Search Paths.
- Add
$(SRCROOT)/../node_modules/react-native-izooto/ios
and set it asrecursive
.
Modify your Framework Search Paths
See this solution.
Event Handlers / Observers Not Firing
If you are having trouble getting events such as opened
to fire correctly, there can be several causes.
Unmounted Components
The most common cause of event listeners not firing is if you use a component as an event listener that later gets unmounted. For example, if you have a sub-component in your app like a Profile page, and you add that profile component as an event listener, everything will work when the profile page is mounted. However, when the user navigates to a different page in your app, the Profile page will get unmounted and your event listeners will be removed.
To troubleshoot this: use console.log
statements for both addEventListener
and removeEventListener
. Make sure that the last log statement was from code that was adding an event listener.
Background Execution
Please note that iOS and Android can be aggressive about preventing background app execution. This means that, in many cases, the received
event will not fire when your app is in the background. Please consider using an Extension/Extender service in your app; however, this will require writing native Objective-C/Java.
Bad Navigation/UI
Many developers put UI code in their opened
or received
event listeners, which most often turns out the issue behind the listeners not firing. Please double check to make sure the event gets called using console.log
or breakpoints.
Use of Unresolved Identifier 'RCTiZootoExtensionService'
If you added the Notification Service Extension using Swift, this sometimes complicates things. Unless you want to customize how the extension service works (almost no one ever needs to do this), it is recommended to delete your extension service target completely, and re-create it, as outlined in our setup guide.
Android - Multiple dex files define:
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzr;
Please make sure you have correctly followed our setup guide.
Make react-native-izooto work with ExpoKit after ejecting from Expo-CRNA
If you have detached from Expo or CRNA, you might need to fix versions of the Google Play Services that this library is using to make it work properly with ExpoKit (as of SDK23). Please follow our setup guide which will make sure all the correct versions are used.
Android - Multiple Libraries Android Errors
If you see this type of error:
Error: more than one Library with package name 'com.google.android.gms.license'
or
java.lang.AbstractMethodError: abstract method "void com.google.firebase.iid.zzb.zzd(android.content.Intent)"
This error means there was a mixture of different Firebase modules included in your app. If you add our plugin, this will fix the version issue in your project and should resolve that runtime error.
If you already have this in your build.gradle
, make sure it is at line 1 of the file. Also, ensure this is added to your app/build.gradle
instead of android/build.gradle
or the root one.
Unsupported Modules Detected
Compilation is not supported for the following modules: react-native-izooto, react-native-svg. Unfortunately, you can't have non-Gradle Java modules and Android-Gradle modules in one project.
Follow these steps:
- Close the project.
- Close Android Studio IDE.
- Delete the
.idea
directory. - Delete all
.iml
files. - Open Android Studio IDE and import the project.
Updated almost 3 years ago