react-native-ssl-pinning
react-native-ssl-pinning copied to clipboard
Not Compatible with RN 0.72
trying tu run app with RN 0.72
after upgrading and running react-native run-android i get the following error:
Could not create task ':react-native-ssl-pinning:compileDebugJavaWithJavac'.
In order to compile Java 9+ source, please set compileSdkVersion to 30 or above
BUILD FAILED in 54s error Failed to install the app. Command failed with exit code 1: gradlew.bat tasks FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':tasks'. > Could not create task ':react-native-ssl-pinning:compileDebugJavaWithJavac'. > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 54s
Here is the diff that solved our problem using patch-package:
diff --git a/node_modules/react-native-ssl-pinning/android/build.gradle b/node_modules/react-native-ssl-pinning/android/build.gradle
index efb23b8..eae7828 100644
--- a/node_modules/react-native-ssl-pinning/android/build.gradle
+++ b/node_modules/react-native-ssl-pinning/android/build.gradle
@@ -12,7 +12,7 @@ buildscript {
apply plugin: 'com.android.library'
android {
- compileSdkVersion 28
+ compileSdkVersion 30
buildToolsVersion "28.0.3"
defaultConfig {
add this in build file inside buildscript-> subprojects { subproject -> afterEvaluate{ if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) { android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion } } } }
Did you guys manage to solve this? i tried upgrade the compileSdkVersion to 30 but still face the issue. Can someone help?
Did you guys manage to solve this? i tried upgrade the compileSdkVersion to 30 but still face the issue. Can someone help?
I've made a fork >
https://github.com/MaxToyberman/react-native-ssl-pinning/compare/master...pipo151086:react-native-ssl-pinning:master
"TEMOPORARY WORKAROUD"
Thanks for the fast respond!
The app still crashes on start and i get the error:
Fatal Exception: java.lang.IllegalStateException: SSLContext is not initialized. at com.android.org.conscrypt.OpenSSLContextImpl.engineGetSocketFactory(OpenSSLContextImpl.java:118) at javax.net.ssl.SSLContext.getSocketFactory(SSLContext.java:338) at kk.a.d(:54) at com.toyberman.RNSslPinningModule.fetch(:85) at java.lang.reflect.Method.invoke(Method.java) at com.facebook.react.bridge.JavaMethodWrapper.invoke(:148) at com.facebook.react.bridge.JavaModuleWrapper.invoke(:147) at com.facebook.jni.NativeRunnable.run(SourceFile) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage() at android.os.Looper.loop(Looper.java:237) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(:37) at java.lang.Thread.run(Thread.java:919)
You have to save .cer file in your assets to make it work.
On Tue, 26 Sep 2023 at 8:17 PM, Harel Hanum @.***> wrote:
Thanks for the fast respond!
The app still crashes on start and i get the error:
Fatal Exception: java.lang.IllegalStateException: SSLContext is not initialized. at com.android.org.conscrypt.OpenSSLContextImpl.engineGetSocketFactory(OpenSSLContextImpl.java:118) at javax.net.ssl.SSLContext.getSocketFactory(SSLContext.java:338) at kk.a.d(:54) at com.toyberman.RNSslPinningModule.fetch(:85) at java.lang.reflect.Method.invoke(Method.java) at com.facebook.react.bridge.JavaMethodWrapper.invoke(:148) at com.facebook.react.bridge.JavaModuleWrapper.invoke(:147) at com.facebook.jni.NativeRunnable.run(SourceFile) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage() at android.os.Looper.loop(Looper.java:237) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(:37) at java.lang.Thread.run(Thread.java:919)
— Reply to this email directly, view it on GitHub https://github.com/MaxToyberman/react-native-ssl-pinning/issues/190#issuecomment-1735696485, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HQZVLAJ6ZK62RAFMSSYXTX4LTHJANCNFSM6AAAAAAZQXMZQA . You are receiving this because you commented.Message ID: @.***>
Ive done that, but still get the same error. on develop the app works fine, the difference between develop to my branch is the whole v0.72 upgrade changes. develop uses version v0.67.5