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

_reactNativeMdm2.default.isSupported is not a function. #14

Open
yuxiaoma opened this issue May 9, 2018 · 10 comments
Open

_reactNativeMdm2.default.isSupported is not a function. #14

yuxiaoma opened this issue May 9, 2018 · 10 comments

Comments

@yuxiaoma
Copy link

yuxiaoma commented May 9, 2018

Hi @ajwhite

I am very glad someone has built this bridge for react native to better integrate with MDM. Thank you!
However, I keep getting this error saying
TypeError: _reactNativeMdm2.default.isSupported is not a function
or
TypeError: _reactNativeMdm2.default.getConfiguration is not a function

I called these function exactly like instructed in your README.md file.
Is something deprecated or changed?

I am on "react-native-mdm": "^1.0.4"

Thanks

@atticoos
Copy link
Contributor

atticoos commented May 9, 2018

@yuxiaoma could you double check that you've properly linked the Native Module on the native side? It doesn't look like we describe the setup process, apologies. You'd link it natively like you would normally with a RN module; no extra steps with react-native-mdm

@yuxiaoma
Copy link
Author

yuxiaoma commented May 9, 2018

yes, that turns out to be the issue. thanks for the quick reply.
Guild for RN linking libraries, in case anyone have the same problem:
https://facebook.github.io/react-native/docs/linking-libraries-ios.html

@yuxiaoma yuxiaoma closed this as completed May 9, 2018
@yuxiaoma
Copy link
Author

yuxiaoma commented May 10, 2018

@ajwhite
I still have problems running my app after installing this package.
Here are the steps that I took:
$ yarn add react-native-mdm
The dependencies are added successfully.
$ react-native link react-native-mdm
Then I get:

rnpm-install info Linking react-native-mdm ios dependency 
rnpm-install info Platform 'ios' module react-native-mdm has been successfully linked 
rnpm-install info Linking react-native-mdm android dependency 
rnpm-install ERR! Something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/username/folder/Appdir/android/app/src/main/java/com/project/mobile/android/MainApplication.java' 
Please file an issue here: https://github.com/facebook/react-native/issues 

ENOENT: no such file or directory, open '/Users/username/folder/Appdir/android/app/src/main/java/com/project/mobile/android/MainApplication.java' 

Then I did the link again I got:

rnpm-install info Platform 'ios' module react-native-mdm is already linked 
rnpm-install info Platform 'android' module react-native-mdm is already linked 

I was able to build the app successfully, but it crashes without any error output the secound it start to run.

I'm pretty sure the app stopped working after linking the package, isolated all other factors. Did I do something wrong here? What should be the steps to make for this to work?
I'm kind new to RN so would you please explain the details, FYI the app halts on device, and quit on similator.

Thank you very much!

@yuxiaoma yuxiaoma reopened this May 10, 2018
@atticoos
Copy link
Contributor

FYI the app halts on device, and quit on similator.

Is this happening on Android or iOS?

react-native link react-native-mdm

Looks like we haven't added support for automated linking. In the meantime, reset your changes and link manually

@yuxiaoma yuxiaoma reopened this May 10, 2018
@yuxiaoma
Copy link
Author

This is happening on iOS.

I will try to link manually, but it would great if the package has automated linking support.

@atticoos
Copy link
Contributor

it would great if the package has automated linking support.

For sure, let's keep this issue open to track that

@tommar11
Copy link

tommar11 commented Feb 8, 2019

Hi, I have a problem with building an app with react-native-mdm library for iOS. Below is the error which I get:
node_modules/react-native-mdm/ios/RNMobileDeviceManager.h:8:9: fatal error: module 'AppConfigSettingsFramework' not found

I did manual link of the library to my Xcode project. I added AppConfigSettingsFramework.framework and libRNMobileDeviceManager.a libraries to the "Link Binary With Libraries" section in Build Phases and locally it works, but on the build server I get an error. It looks like RNMobileDeviceManager library is build before AppConfigSettingsFramework. How can I enforce proper build order?

@DiegoNegri
Copy link

DiegoNegri commented Mar 8, 2019

Hi, i have the same problem, i solved it opening the RNNMobileDeviceManager.xcodeproj and setting in 'Build Phases' 'AppConfigSettingsFramework' as Target Dependencies.

Hi @ajwhite what do you think about applying this change in next release ?

@antoniogoulao
Copy link
Contributor

antoniogoulao commented Sep 24, 2020

Hi all. @DiegoNegri and @ajwhite I was facing the same issue after running yarn add [email protected] and launching the project. I then ran cd ios && pod install and launched the project again in the emulator and it worked.

Would it be a good idea to add this to the README file?

@puneetkansal04
Copy link

puneetkansal04 commented Apr 7, 2021

Hi @ajwhite @DiegoNegri @blainsadler @zachdunn @mcos @samdunn @brianmuse can i get Screen time in the IOS using this library. Please provide me detail for this. As i am getting some error while using it.

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

6 participants