react-native-mdm icon indicating copy to clipboard operation
react-native-mdm copied to clipboard

_reactNativeMdm2.default.isSupported is not a function.

Open yuxiaoma opened this issue 6 years ago • 10 comments

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

yuxiaoma avatar May 09 '18 00:05 yuxiaoma

@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

atticoos avatar May 09 '18 00:05 atticoos

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 avatar May 09 '18 02:05 yuxiaoma

@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 avatar May 10 '18 01:05 yuxiaoma

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

atticoos avatar May 10 '18 03:05 atticoos

This is happening on iOS.

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

yuxiaoma avatar May 10 '18 03:05 yuxiaoma

it would great if the package has automated linking support.

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

atticoos avatar May 10 '18 18:05 atticoos

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?

tommar11 avatar Feb 08 '19 12:02 tommar11

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 ?

DiegoNegri avatar Mar 08 '19 08:03 DiegoNegri

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?

antoniogoulao avatar Sep 24 '20 15:09 antoniogoulao

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.

puneetkansal04 avatar Apr 07 '21 15:04 puneetkansal04