ccnnde/react-native-simple-openvpn

Package doesn't work on RN last version

Closed this issue · 6 comments

Hi!

I downloaded clean RN project by official tutorial.

React Native CLI, Windows, Android. All's work correctly. Then I downloaded npm install --save react-native-simple-openvpn, react-native link react-native-simple-openvpn, added your example against of code of App.jsandrun android`.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 6 executed
Note: C:\Users\analyzingMerrymaker\dev\LGERN\node_modules\react-native-gradle-plugin\src\main\java\com\facebook\react\codegen\generator\SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\analyzingMerrymaker\dev\LGERN\node_modules\react-native-simple-openvpn\android\build.gradle' line: 68

* What went wrong:
A problem occurred evaluating project ':react-native-simple-openvpn'.
> Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

If you fix the errors directly in the package, the connect function will not work.

After replacing compile with implementation I got:

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\analyzingMerrymaker\dev\LGERN\node_modules\react-native-simple-openvpn\android\src\main\AndroidManifest.xml Error:
        android:exported needs to be explicitly specified for <service>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

After android:exported="true" project's builded, but when we push on "CONNECT" project falls

await RNSimpleOpenvpn.connect({
        remoteAddress: '',
        ovpnFileName: 'Japan', // Japan or Russian (android assets folder)
        assetsPath: '',
        providerBundleIdentifier: 'com.your.network.extension.bundle.id',
        localizedDescription: 'TestRNSimpleOvpn',
});

The file "Japan" (default config) definitely exists.

This week I should release version 2.0.0 which supports the latest version of RN.

v2.0.0 has released