Closed gkasireddy202 closed 3 months ago
Hi Team,
Please look at the issue. I facing this issue on Android.
Hi Talsec Team, Is our error submission and request for assistance appropriate in this repository, or is there a more appropriate support request site? Thank you.
Hello @gkasireddy202 , @PaulHedrich ,
we will look at the issue and get back to you soon. Thank you for reporting it!
Kind regards, Talsec team
Hello @gkasireddy202, @PaulHedrich,
It seems like Android Studio is using some version of Kotlin that is not compatible with 1.7.0, which is the default for freerasp. You can modify the version of Kotlin for freerasp in top-level build.gradle file in buildscript.ext section. Try to set "kotlinVersion" property to the version you use in Android Studio.
Let us know if it helped.
Best, Tomas from Talsec
@tompsota - Thanks for your reply. Can I set kotlinVersion property in my project level(MyProject>android>build.gradle) or node_modules>freersap-react-native>android>build.gradle?
If I add kotlinVersion in the project level could it affect other react-native components in my project?
@tompsota - I installed the freerasp-react-native component in react-native:0.73.7. I am trying to generate the apk in release mode and getting the below errors.
Task :freerasp-react-native:minifyReleaseWithR8 FAILED AGPBI: {"kind":"error","text":"com.android.tools.r8.internal.Ub: Sealed classes are not supported as program classes when generating class files","sources":[{"file":"/MyProject/node_modules/freerasp-react-native/android/build/tmp/kotlin-classes/release/com/freeraspreactnative/Threat.class"}],"tool":"R8"}
com.android.tools.r8.internal.Ub: Sealed classes are not supported as program classes when generating class files.
ext { buildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0" }
react-native:0.73.7 java:18.0.2.1
Hi @gkasireddy202,
Can I set kotlinVersion property in my project level(MyProject>android>build.gradle) or node_modules>freersap-react-native>android>build.gradle?
You can set it in project level, but that could affect also other packages. You would have to try and see if the project compiles successfully. It is also possible to change the kotlin version just for freerasp:
FreeraspReactNative_kotlinVersion
variable. However, I'm not sure if freerasp would compile with lower version of kotlin.com.android.tools.r8.internal.Ub: Sealed classes are not supported as program classes when generating class files.
This is unfortunately issue with AGP version used in react-native:0:73, see this part of troubleshooting for more info and fix: https://github.com/talsec/Free-RASP-ReactNative?tab=readme-ov-file#execution-failed-for-task-freerasp-react-nativeminifyreleasewithr8
Hi @tompsota ,
I checked the Gradle version in my project:distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip As in the Google tracker, we do not have maven in android>build.gradle.We recently targeted my project to targetSdkVersion = 34.
Hi @gkasireddy202,
you can place following dependency into android/build.gradle like so:
buildscript {
dependencies {
classpath("com.android.tools:r8:8.3.37")
}
}
After that, the project should compile in release build.
Or alternatively, place the code from the Google issue tracker into android/settings.gradle
Best, Tomas from Talsec
Hello @gkasireddy202,
did the proposed solution worked? Thank you!
Kind regards, Talsec team
@msikyna - Yes. It is working fine now.
Describe the bug Unable to run on Android device.
To Reproduce Open the project after installing the package:npm install freerasp-react-native. My project does not run and shows the below error. A problem occurred configuring project ':freerasp-react-native'.
Expected behavior Run the app on an Android device
Screenshots If applicable, add screenshots to help explain your problem.
Please complete the following information:
Additional context Add any other context about the problem here.