I'm trying to run on the iOS simulator but keep receiving this error:
Native module cannot be null.
Image of error:
Did you do in ios directory the Podfile installation ?
cd ios
pod install
Related
I'm receiving the following error when trying to run my React Native app for iOS on Xcode: "'React/RCTMockDef.h' file not found". I'm on React Native v0.67.2 and I've already tried doing cd ios and pod install. Can anyone help? Thanks
cannot run ionic on ios, error comes from cordova itself where default target is undefined.
ionic cordova run ios --debug
gives error:
TypeError: Cannot read property 'name' of undefined
at /Users/user/project//platforms/ios/cordova/lib/build.js:162:60
at _fulfilled (/Users/user/project//node_modules/q/q.js:854:54)
at /Users/user/project//node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/user/project//node_modules/q/q.js:816:13)
at /Users/user/project//node_modules/q/q.js:624:44
at runSingle (/Users/user/project//node_modules/q/q.js:137:13)
at flush (/Users/user/project//node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:61:11)
Please update your iOS cordova platform to v5 like:
ionic cordova platform rm ios
then
ionic cordova platform add ios#5
Don't forget to update the resources, as you might find some "Cordova bot" images in your resources under "Xcode assets".
When I run: ionic build ios the archive succeeds but the export fails.
Error Messages:
error: exportArchive: Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'
Error Domain=IDEFoundationErrorDomain Code=1 "Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'" UserInfo={NSLocalizedDescription=Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'}
Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,fasTask.xcarchive,-exportOptionsPlist,/Users/**PATH**/platforms/ios/exportOptions.plist,-exportPath,/Users/**PATH**/platforms/ios/build/device
I modified the exportOptions.plist 'method' key to 'export_method' but same error message.
I tried uninstalling Xcode and re-installing. The first build after re-installation gives me a successful build. Any builds after the first build give me the same error message as before.
Also if I npm uninstall -g ionic cordova and delete everything in the platform folder, then npm install -g ionic cordova then the first build succeeds but any build after it fails.
ionic serve works fine every-time.
Details:
Xcode 7.3.1
ionic 2.1.14
cordova 6.4.0
cordova-ios 4.3.1
ios-deploy 1.9.0
Thanks.
Hey I am having the same issue, it happened after updating ionic and cordova to the lastest version. I created a new project ionic start added platform ios and when trying ionic run ios --device i got the same output that you're having after building trying to export.
When running an older (pre-update) project i was not having any problem at all after i did a ionic platform rm ios and then ionic platform add ios the problem reproduced again. I think is has to be to the way that the updated cli is adding the platform or that it is expecting an updated SDK version (Xcode 8).
A workaround is first launch and installing the app to the device using Xcode, then in the terminal do ionic run ios --device -l this will create a livereload ionic server. At the end it will show the error but the livereload server will be still working and you can develop and the changes will be reflected on the app without any problem.
Xcode: 7.3.2
Ionic: 2.1.13
Cordova: 6.4
Try
ionic build ios --emulator
Ran add ios and build ios fine, but then I ran ionic emulate ios and it brought up the xcode emulator but with no app or button for my app (just safari, maps, etc.).
I then later ran ionic emulate ios --target="iPhone-5s" and got this error:
BUILD SUCCEEDED
An error was encountered processing the command
(domain=com.apple.CoreSimulator.SimError, code=159): Invalid device
state An error was encountered processing the command
(domain=com.apple.CoreSimulator.SimError, code=159): Invalid device
state
ENOENT: no such file or directory, stat
'/Users/sh/Library/Logs/CoreSimulator/62773263-27DC-4E83-9C6A-ED2B73DC3F0A/system.log'
Error code 1 for command: ios-sim with args:
launch,/Users/sh/Desktop/shapp/platforms/ios/build/emulator/shapp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-5s,--stderr,/Users/sh/Desktop/shapp/platforms/ios/cordova/console.log,--stdout,/Users/sh/Desktop/shapp/platforms/ios/cordova/console.log,--exit
Error: /Users/sh/Desktop/shapp/platforms/ios/cordova/run: Command
failed with exit code 2
SHs-iMac:shapp sh$ q
-bash: q: command not found
Not sure what I did wrong as I added and built ios correctly.
It also worked correctly when pulled up in xcode although there are these warnings for both running with 5s and 6. I think it is an ionic issue not being able to emulate ios just not sure how to fix it?
Do this:
Update ios-sim package: npm install ios-sim -g
Update cordova: npm install -g cordova
Remove iOS platform: ionic platform rm ios
Add iOS platform: ionic platform add ios
i have created a new hello world project using the following command,
cordova create hello com.example.hello HelloWorld
the project is created successfully, then i add the ios platform by
cordova platform add ios
and to verify i have it added correctly, i type
cordova platform list
the iOS platform is shown in the list. so at this point, according to the PhoneGap tutorial, i can use the command
cordova build ios
to build the iOS version of the project. however, i encounter the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
the results that i have googled are mostly concerning the android version, talking about the invalid environment path setting. i dont know if it is related since i can create and build a PhoneGap project targeting the android platform without problem.
here is my $PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm:/Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/tools
EDIT:
problem solved by re-installing xcode from app store
I had the same problem in Android platform, and it was solved with the commands:
cordova platform rm android
cordova platform add android
cordova build android
in Node.Js console. try it in ios.
If you get an error with 'cordova platform add android', you may need to manually remove any android folders in your project folder hierarchy.
This resolved my issue:
cordova platform remove ios
cordova platform add ios
cordova build ios
If you run the build with --verbose, you will probably see some permission issues. By default, XCode creates a folder of the build in ~/Developer, if you haven't changed it. There probably is a permissions issue when creating that folder. Just execute the following command: sudo cordova bulid ios
That should fix your issue.