Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Compatible with RN 0.72 #190

Open
pipo151086 opened this issue Jun 22, 2023 · 7 comments
Open

Not Compatible with RN 0.72 #190

pipo151086 opened this issue Jun 22, 2023 · 7 comments

Comments

@pipo151086
Copy link

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

@Moayad-92
Copy link

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 {

squio added a commit to squio/react-native-ssl-pinning that referenced this issue Aug 2, 2023
Project fails to build with React Native 0.72+ because of minimum Android API target requirement

This is the minimal fix for MaxToyberman#190
@dogra-deepak-tftus
Copy link

dogra-deepak-tftus commented Sep 19, 2023

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
}
}
}
}

@HareHanum
Copy link

Did you guys manage to solve this? i tried upgrade the compileSdkVersion to 30 but still face the issue.
Can someone help?

@pipo151086
Copy link
Author

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 >

master...pipo151086:react-native-ssl-pinning:master

"TEMOPORARY WORKAROUD"

@HareHanum
Copy link

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)

@dogra-deepak-tftus
Copy link

dogra-deepak-tftus commented Sep 26, 2023 via email

@HareHanum
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants