-
Notifications
You must be signed in to change notification settings - Fork 51
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
Error: Undefined an object reactNativeAndroidLocationEnabler2 #17
Comments
Can you post the code, that lead you to this error ? |
Ok, I'll will check this asap. |
same issue plz |
Did you add the following lines in your android/settings.gradle include ':react-native-android-location-enabler'
project(':react-native-android-location-enabler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-location-enabler/android') And this line in dependencies section of your android/app/build.gradle compile project(':react-native-android-location-enabler') And finally in your MainApplication.java import com.heanoria.library.reactnative.locationenabler.RNAndroidLocationEnablerPackage; // Import line
public class MainApplication extends Application implements ReactApplication {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNAndroidLocationEnablerPackage() // And this one
);
}
} |
I will try and thanks for reply
…On Sun, Jan 13, 2019, 03:37 Richard ***@***.***> wrote:
Did you add the following lines in your android/settings.gradle
include ':react-native-android-location-enabler'
project(':react-native-android-location-enabler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-location-enabler/android')
And this line in dependencies section of your android/app/build.gradle
compile project(':react-native-android-location-enabler')
And finally in your MainApplication.java
import com.heanoria.library.reactnative.locationenabler.RNAndroidLocationEnablerPackage; // Import line
public class MainApplication extends Application implements ReactApplication {
@OverRide
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNAndroidLocationEnablerPackage() // And this one
);
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AsMRMbUw9CTU6-aca1BtIJfatxsg90R0ks5vClyqgaJpZM4Y86_e>
.
|
Same issue here.. |
Did you follow the installation instruction correctly ? |
same issue |
yes |
|
@devnasim Did you import the RNAndroidLocationEnabler in your code ? import RNAndroidLocationEnabler from 'react-native-android-location-enabler'; |
does it work on expo ? |
when I import the module |
@andrey-shostik Are you running this on iOS, as far as I'm concerned this will be null or undefined for iOS, wrap this function inside a platform check. I have realised this only works with Android since it's there's a different procedure for toggling location on and off for iOS.
|
Same problem here, did anyone find the solution? |
A had the same problem. |
Unfortunately I'm using the expo, but I had looked at a topic here and they said it works = ( |
|
please anyone proper solution for that? |
I run this package with genymotion -- android 6.0 and have this error
Please give me any help.
Thanks!
package.js:
The text was updated successfully, but these errors were encountered: