angularjs cordova application using cordova plugin - angularjs

I am trying to work with angularjs and cordova application and I need to use cordova plugin such as map and geolocation. I saw ngCordova but that does not offer map plugin. For testing purpose i tried to add geolocation plugin but it is not building ios app at all
clang: error: no such file or directory: '/Users/asifalamgir/Documents/hungryHaven/hungryHavenApp/platforms/ios/hungryHaven/Plugins/org.apache.cordova.geolocation/CDVLocation.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
** BUILD FAILED **
The following build commands failed:
CompileC build/hungryHaven.build/Debug-iphonesimulator/hungryHaven.build/Objects-normal/i386/CDVLocation.o hungryHaven/Plugins/org.apache.cordova.geolocation/CDVLocation.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: /Users/asifalamgir/Documents/hungryHaven/hungryHavenApp/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Thank you

Possible reasons can be:
There has been an error installing the plugin. You can try reinstalling it:
cordova plugin rm org.apache.cordova.geolocation
cordova plugin add org.apache.cordova.geolocation
Also (not most probably but could be) try with preparing the app again:
cordova prepare ios
Or even sometimes you can try removing the whole ios app and adding it again:
cordova platform rm ios
cordova platform add ios

The way I was able to resolve it was :
Deleting the platforms ios folder/directory.
Adding the geolocation plugin (cordova plugin add org.apache.cordova.geolocation)
Adding back ios platform (ionic platform add ios).

Related

Building hybrid mobile apps with Cordova, React and Nrwl Nx

I'm working on a proof of concept for my company to demonstrate how our monorepo could benefit from Nx and hybrid mobile apps. So far, I have one Nx project containing some reusable components (as Nx libraries) which I publish to my local npm registry. I have a second React application created through create-react app in which I consume the packages published in the first application. I then need to build a hybrid mobile application based on the second application to demonstrate the app working in various platforms and consuming the common libraries.
So far, in my poc, was able to complete the previous steps and get the hybrid mobile app working with using Capacitor using the nxtend plugin for Nx (https://nxtend.dev/docs/capacitor/overview). As another task, I also need to build another hybrid mobile app using Cordova. I understand that I can use hooks in Cordova to write a script which could first make a build of the react app and then run it in mobile platforms, and attempted it. However, when I run the app in Cordova (using cordova run ios), the virtual device only displays a blank page. I was wondering if I need to follow different steps to install packages to consume for Cordova to work or if there was a different way to accomplish this.
I followed this article to integrate React with Cordova, but I get this error:
$ cordova run android
Error: Command failed: /.../cordovaProject/node_modules/.bin/react-scripts build
at ChildProcess.exithandler (child_process.js:383:12)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) {
killed: false,
code: 1,
signal: null,
cmd: '.../cordovaProject/node_modules/.bin/react-scripts build'
}
Command failed: ...cordovaProject/node_modules/.bin/react-scripts build

Expo run:ios generating error PhaseScriptExecution

I have an expo managed app and I want to use a notification library called OneSignal which has an expo plugin. This plugin adds native code not supported by Expo Go, so I'm forced to enter bare workflow and build native iOS and Android folders.
I'm building the iOS package by running expo run:ios. And build fails due to something with PhaseScriptExecution. This is my log:
2022-06-09 15:10:39.377 xcodebuild[35947:834210] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-06-09 15:10:39.377 xcodebuild[35947:834210] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ app.config\ for\ prebuilt\ Constants.manifest /Users/celsomattos/Library/Developer/Xcode/DerivedData/teste-gcaxmzswwhjxgrfhkfyporjorevj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/EXConstants.build/Script-46EB2E0000D7B0.sh (in target 'EXConstants' from project 'Pods')
(1 failure)
Expo version incompatible?

How to update Android SDK in m generator project?

I had created m generator project, after I ran this project I got this error message how do i solve this problem
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
I faced this problem this android sdk version problem.
you can use this line in terminal (project path):
$ cordova platforms remove android
$ cordova platforms add android

how to resolve this ERROR running one or more of the platform when i am runnning "ionic run android --device"

$ ionic run android --device
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\user\Desktop\transroads\jvdappNew\jvdApp\hooks\after_prepare\010_add_platform_class.js C:/Users/user/Desktop/transroads/jvdappNew/jvdApp
add to body class: platform-android
ERROR running one or more of the platforms: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
You may not have the required environment or OS to run this project.
It was working properly but when i updated my Android Studio there is installed another SDK also now i am having two SDK in the ANDROID_HOME path those are SDK and SDK1. SDK is having API23 and SDK1 API24.
whenever i am running command "ionic run android --device" terminal always shows that error i have discuss above.
Before update of Android Studio everything was working properly but after the update i am unable to run ionic application on my mobile device.ANDROID_HOME path is C:\Users\user\AppData\Local\Android\sdk; and i am having SDK1 folder also after the Android Studios updation on that location.
AVD Manager.exe and SDK Manager.exe those files are only in SDK and SDK1 having nothing like that.Please help me out of this.
Anyone please tell me both the platform can run over a SDK Manager?
You need to update your cordova android platform. Basically the older version till 6.2.0 used android command which is deprecated in the SDK.This was patched in 6.2.0
Check this answer for more info.
Update your cordova cli first:
npm install -g cordova#latest
You can update to the latest platform by doing:
ionic platform add android#6.2.3
Or
ionic platform add android#latest
For IONIC CLI v3 the command is:
ionic cordova platform add android#latest

sencha app build -run native Errors

I'm starting with sencha touch, and I trying to prepare the environment with Sencha Touch (Cmd 4.0.1.45) and touch 2.3.1 and Cordova 3.2.0-0.4.0. I saw in some posts that in MAC we don't need to install SDK, just Cmd.
I did many many things, configure Java, Android, Paths, Ruby, Ant, Compass, Phonegap, Cordova, etc.
It's all right with comands:
sencha generate app and sencha cordova init or in case of phonegap sencha phonegap init. It works.
The big big problema is when I try to do sencha app build -run native. That works, but i have the follow message:
[INF] -cordova-platform-add:
[INF] [script] Cordova: Missing platforms ios. Attempting add.
[INF] [shellscript] Checking iOS requirements...
[INF] [shellscript] Creating ios project...
[INF] [shellscript] [Error: An error occured during creation of ios sub-project.
[INF] [shellscript] cp: /Applications/MAMP/htdocs/appUm/cordova/platforms/ios/www/cordova.js: No such file or directory
[INF] [shellscript] ]
[ERR] The following error occurred while executing this line:
/Applications/MAMP/htdocs/appUm/.sencha/app/build-impl.xml:422: The following error occurred while executing this line:
/Applications/MAMP/htdocs/appUm/.sencha/app/cordova-impl.xml:170: The following error occurred while executing this line:
jar:file:/Users/zetoniazzo/Documents/Mobile/senchaCmd/Sencha/Cmd/4.0.1.45/sencha.jar!/com/sencha/ant/antlib.xml:608: shellscript returned: 1
Environment:
MAC OS
Sencha Touch Cmd 4
Touch 2.3.1
Cordova 3.2
Java 1.7
Ant 1.9.2
I believe Java, ant, Cordova, Ruby, COmpass, etc, it's all right. The big problem is app build. I had many kinds of errors, but this one i can't solve!!!!
The problem is to cordova and phonegap, trying to generate to IOS and android. I`m desgusting about it!
Another thing, where I take cordova.js?
It's hard! And in windows 8 it works to Android....
Thanks
Though i think it's too late, but have you installed the ios simulter?
sudo npm install ios-sim
Anyway,you need to do this in the root of the sencha projeci even if it doesn't work:
sencha cordova remove
then, remove the dir of /cordova
rm -r cordova
then:
sencha cordova init
and:
sencha app build native
I wish it will help you.

Resources