ccnnde/react-native-simple-openvpn

Unable to resolve "react-native-simple-openvpn" from "App.js"

Closed this issue · 1 comments

i have installed & linked the package as mentioned in docs, got the jnilibs and put them in the right place. but i kept getting this error
Unable to resolve "react-native-simple-openvpn" from "App.js"

Here is my App.js code:

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import RNSimpleOpenvpn, { addVpnStateListener, removeVpnStateListener } from 'react-native-simple-openvpn';

export default function App() {

async function startOvpn() {
try {
await RNSimpleOpenvpn.connect({
remoteAddress: 'serverexample 80',
ovpnFileName: 'client',
username: 'username',
password: 'password',
});
} catch (error) {
// ...
}
}

return (

Open up App.js to start working on your app!

  <TouchableOpacity style={{padding:100, backgroundColor:"#ffb800"}} onPress={startOvpn}>Click To Connect</TouchableOpacity>
  <StatusBar style="auto" />
</View>

);
}

What is your react native version? You can run the example to see if it works.

And you can try to initialize a new project and test again.