Tag Archives: react native

React Native Publishing an Android App

How to fix com.myapp.MainApplication cannot be cast to com.facebook.react.ReactApplication

To fix this issue, thats happening when using react-native-push-notification package with Expokit, you will need to go into your android/src/main/java/host/exp/exponent and open up the MainApplication.java file. The file needs to be edited and changed, so you avoid any errors with getting push notifications. A sample file looks like this: package host.exp.exponent; import com.facebook.react.ReactPackage; import java.util.Arrays; […]

React Native Publishing an Android App

Dismiss keyboard in multiline TextInput in React native

By doing below code , you keyboard show return key you wanted for example “done”, “go” and also dismiss the keyboard when you press return key in my case done key while using multi line seamlessly. import {Textinput, ScrollView, Keyboard} from ‘react-native’; // …code <TextInput keyboardType=”default” returnKeyType=”done” multiline={true} blurOnSubmit={true} onSubmitEditing={()=>{Keyboard.dismiss()}} />

React Native Publishing an Android App

Fix package com.android.annotations does not exist

Here is how to automatically fix all android to androidx issues for React Native. 1. Please check that you have NPX installed and if not, install it with: npm install -g npx 2. Add the following two flags to true in your gradle.properties file at ProjectFolder/android/gradle.properties android.useAndroidX=true android.enableJetifier=true 3. Execute these lines: npm install –save-dev […]

React Native Publishing an Android App

React Native Publishing an Android App

Add/Create Keystore This command will create a keystore with the given name if the file doesn’t exist or append a key to a current keystore. keytool -genkey -v -keystore mykeystore.keystore -alias mykeyalias -keyalg RSA -keysize 2048 -validity 10000 After you have generated the mykeystore.keystore file copy it to android/app. Setting up gradle variables Append the snippet […]