I am new to react-native.
We are integrating the react native source code into an existing android project.
We are following the below tutorial :
https://medium.com/mindorks/react-native-integration-with-existing-app-f2757c2e672d
After adding the required react-native classes and following all steps, we are facing some crash issues when we are switching android activity to react-native activity.
Here is the crash issue
Caused by: java.lang.IllegalAccessError: Method 'void
androidx.core.net.ConnectivityManagerCompat.()' is inaccessible
to class 'com.facebook.react.modules.netinfo.NetInfoModule'
(declaration of 'com.facebook.react.modules.netinfo.NetInfoModule'
appears in /data/app/com.ttl.reactintegrationdemo-2/base.apk)
Related
I am trying to run Akka (typed) on Android 8. However when I try to create the ActorSystem it fails because the akka.util.Unsafe class try to access a missing "value" field on String:
// 'instance' being of type sun.misc.Unsafe
stringValueFieldOffset = instance.objectFieldOffset(String.class.getDeclaredField("value"));
Caused by: java.lang.NoSuchFieldException: No field value in class Ljava/lang/String; (declaration of 'java.lang.String' appears in /system/framework/core-oj.jar)
at java.lang.Class.getDeclaredField(Native Method)
at akka.util.Unsafe.(Unsafe.java:36)
I tried with Akka 2.6.19 and 2.5.32 but also 2.5.21 with Scala 2.11 but both fails at the same point. I am running it on Android 8.0 (which is a requirement).
Has anyone experienced the same issue and found a solution?
I cannot change the Android version. However, I can change Akka while I would like to use Akka-typed and a recent/supported version.
EDIT; I was not able to find a solution yet. However, I opened a discussion on the project: https://github.com/akka/akka/pull/23710#issuecomment-1091817062
Azure is calling:
URLEncoder.encode(encodeBase64String(...
which works fine on Android 9 and above. But on old phones I get:
Caused by: java.lang.NoSuchMethodError: No static method encodeBase64String([B)Ljava/lang/String; in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.boot.jar)
I have tried adding in :
implementation "commons-codec:commons-codec:1.14"
to build.gradle, but it does not seem to have an effect. What is the usual way to handle it when a class you didn't write that is part of an external SDK, is calling a method old phones don't support?
You should try with below code:
String encodedString = new String(Base64.encodeBase64(bytes));
Hi, I am trying to include in my project using react-native-webrtc react native module but I am getting the following error. The main tip is that I got the same error when I used jitsi. Has anyone encountered this problem before? I've never seen a similar anywhere.
1. Application is receiving build success
2. App crashes when runtime
3. Unfortunately I have no more arguments for solving this problem.
E/System: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.res.StringBlock.close()' on a null object reference
at android.content.res.ApkAssets.close(ApkAssets.java:201)
at android.content.res.ApkAssets.finalize(ApkAssets.java:191)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:929)
Here's the error details:
12-04 22:00:12.087: E/AndroidRuntime(19113):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.package.name.dev/com.package.name.dev.MainActivity}:
java.lang.NullPointerException: Attempt to invoke virtual method 'void
org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String,
org.apache.cordova.CordovaInterface,
org.apache.cordova.CordovaWebView,
org.apache.cordova.CordovaPreferences)' on a null object reference
Background: I was originally only building the app for Android, but during my last release I had to generate an iOS build as well, which required some extra plugins and configuration tweaks to get functional. Now I'm trying to create a new release for Android, but the new app force closes as soon as it is opened.
In an effort to fix it, I tried to remove all references to the iOS-only plugins from the Android side of the project, but the error persists. I'm not sure what else to try.
What would provoke Cordova to throw this error when initializing plugins?
The issue was that one of the plugins had failed to copy its java classes into the Android app src directory when it was installed. I created the appropriate directory hierarchy and then copied in the java files from the /plugins/ dir.
To figure out which plugin caused the issue, I disabled the onload param from each feature one at a time (in the android.json file in the android platform directory) until the app successfully opened.
I ejected from expo for integrating Expo Payments for both IOS and Android. Getting StripeModule as null.
Steps that i have done for Payments
expo eject
Selected ExpoKit option
expo start
Ran project on android studio without applying any change of gradle versions
As this project’s sdk version was > 30 so there were no changes required for payments integration
imports are like this - import {PaymentsStripe as Stripe} from 'expo-payments-stripe';
initializing Stripe in componentDidMount as below:-
Stripe.setOptionsAsync({
publishableKey: 'sk_test_VTUPYk8pxYap0g8fhpg9qdKF',
androidPayMode: 'test', // Android only
})
Getting warning after this code:-
Exception occurred while executing exported method init on module
StripeModule: null
As the StripeModule is null according to the warning above. whenever i call a function to get token, it is giving NullPointerException
java.lang.NullPointerException: Attempt to invoke virtual method 'void
com.stripe.android.Stripe.createToken(com.stripe.android.model.Card,
java.lang.String, com.stripe.android.TokenCallback)' on a null object
reference