I am trying to create a mobile app using and existing web application I have previously developed.
For that I am using NativeScript because it can be used with an existing Angular project using a code-sharing structure.
Following the docs in their website:
https://docs.nativescript.org/angular/code-sharing/migrating-a-web-project
I convert the web project to a code-sharing structure :
ng add #nativescript/schematics
But I am getting a error in the console:
trustedSubscriber._addParentTeardownLogic is not a function
And then when I go to run it in the mobiles:
tns run android --bundle
or
tns run ios --bundle
I am getting an error (Seems that is not detecting it as a NativeScript project):
No project found at or above '/Path/to/my/project' and neither was a --path specified.
Related
How to run moodle mobile app on android studio? I want to add my own plugins as well.
I have followed moodle documentation https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2 but it stuck on Native build dependencies.
Code I am following: https://github.com/moodlehq/moodleapp
Also try to run this code on android studio ( follow:https://www.youtube.com/watch?v=IA3c2lpoOtU&t=757s ),I am having a blank white screen(I have paste moodle src folder on www folder and run the src/index.html)
Can somebody share video tutorial regarding this? It will be really helpful.
At first you need to add android platform to your project by these bash commands:
Removing and adding
npx ionic cordova platform remove android
npx ionic cordova platform remove ios
npx ionic cordova platform add android
npx ionic cordova platform add ios
Once you have added platforms, you can run setup using this command:
npm run setup
After successful setup you can open the the project in android studio:
android studio project location should be CORDOVA_PROJECT_DIRECTORY/platforms/android
Source:
https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2
i had build the ionic project (sample in 'www' folder) and run the sample in browser. but i need to convert the sample/project in to android app, and want to test that sample in my android phone. please provide what are all the software needed to do this and what are all the step by step procedure.
You will need the Android SDK to compile Android code. Set ANDROID_HOME environment variable to the SDK location.
On windows: set ANDROID_HOME=/path/to/sdk
From the command line, run the following command which generates an Android project:
ionic add platform android
Then build an apk file using this command:
ionic build android
Copy the apk to an Android device for testing.
The next step after starting an ionic project and building the app is deployment.
Make sure your device connected to your machine. Make sure android ionic support is enabled via $ionic platform add android. Check that android is supported via $ionic platform list.
Then build your app.
$ionic build android and run it $ionic run android
This should run to the connected device to test. You can also use emulators by adjusting the run syntax.
While trying to do a release using the following command:
code-push release-cordova myApp android
I'm getting the following error in the terminal:
Running "cordova prepare" command:
[Error] Unable to prepare project. Please ensure that this is a Cordova project and that platform "android" was added with "cordova platform add android"
Any one knows what might be wrong? The project is a cordova project created using the command:
cordova create myApp
And also has android platform added.
UPDATE :
Running cordova prepare android --verbose returns the following output :
Executing "before_prepare" hook for all plugins.
Searching PlatformJson files for differences between project vs. platform installed plugins
No differences found between project and android platform. Continuing...
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "HelloCordova"
Wrote out Android package name to "io.cordova.hellocordova"
This app does not have launcher icons defined
updated project successfully
Executing "after_prepare" hook for all plugins.
Make sure your Nodejs is the last version.
code-push-cli required "child_process"
That error indicates that the current working directory didn't represent the root of a Cordova project at the time that you ran the release-cordova command. Can you make sure that you CD into the directory that contains the www, platforms, plugins, etc. directories, and then run the release-cordova command? That should do the trick for you
Cant seem to follow the tutorials for building apps with Mobile first and cordova.
i used mfp cordova create to create an app and named it Idealaketest.
Enter name of app: Idealaketest
Enter the package ID: com.ibm.Idealaketest
have progressed on as far as the code below.
Please help with a workaround or a link to a page with appropriate tuts.
I'm following this at the moment.
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/
D:\Mobilefirst_workspaces\workspace3>mfp cordova create
? Enter name of app: Idealaketest
? Enter the package ID: com.ibm.Idealaketest
? Enter the app version: 1.0.0
? Select platforms to be supported by your app: android
? The following plugins will be automatically added to your app:
cordova-plugin-mfp
org.apache.cordova.device
org.apache.cordova.dialogs
org.apache.cordova.geolocation
org.apache.cordova.globalization
org.apache.cordova.inappbrowser
org.apache.cordova.network-information
Please press enter to continue...
? Select additional plugins you would like to add:
? Enter a path to an app template to be added: cordova-hello-world-mfp
Embedded Cordova Command: cordova create "Idealaketest" "com.ibm.Idealaketest" "
Idealaketest" --copy-from="C:\Program Files\IBM\MobileFirst-CLI\mobilefirst-cli\
node_modules\cordovacmd\cordova\templates\cordova-hello-world-mfp"
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.ibm.Idealaketest
Name: Idealaketest
Android target: android-22
Copying template files...
Project successfully created.
Adding "cordova-plugin-mfp"
Installing "cordova-plugin-mfp" for android
Installing "org.apache.cordova.device" for android
Installing "org.apache.cordova.dialogs" for android
Installing "org.apache.cordova.geolocation" for android
Installing "org.apache.cordova.globalization" for android
Installing "org.apache.cordova.inappbrowser" for android
Installing "org.apache.cordova.network-information" for android
Plugin install completed
CordovaApp.java was renamed to MainActivity.original, if you made manual changes
to CordovaApp.java, you need to merge them with the current main activity file,
CordovaApp.java, in /platforms/android/src/[package_path]
Plugin "cordova-plugin-mfp" added successfully.
Preparing for push...
MFP App settings not found, configuring..
Embedded Cordova Command: cordova prepare android
D:\Mobilefirst_workspaces\workspace3\Idealaketest\mobilefirst\com_ibm_Idealakete
st-android-1.0.0.wlapp has been built.
Push Completed Successfully.
MFP Cordova project created successfully.
D:\Mobilefirst_workspaces\workspace3>mfp start
Cannot find the server configuration. Creating a new MobileFirst test server.
The development server is being created.
The development server has been successfully created with the following informat
ion:
Server Directory: C:/Users/guest/.ibm/mobilefirst/7.1.0.00.20160307-2032/server
/
URL: http://localhost:10080/
Error: You must be in a MobileFirst project to execute this command.
D:\Mobilefirst_workspaces\workspace3>cd Idealaketest
D:\Mobilefirst_workspaces\workspace3\Idealaketest>mfp start
Error: You must be in a MobileFirst project to execute this command.
D:\Mobilefirst_workspaces\workspace3\Idealaketest>mfp cordova preview
? Select how to preview your app: browser: Simple browser rendering
Preparing for push...
Verifying Server Configuration...
Error: There are no runtimes available on this server.
Run 'mfp help intro' for guidance.
Error: error code: 305
Error: There was an error with the server.
Error: MASTERPUSHSERVERFAILED
Error: Push has failed
You didn't a project...
Create the project:
mfp create myproj
cd myproj
mfp start
Create the Cordova project:
cd ..
mfp cordova create myapp
cd myapp
mfp cordova platform add android
mfp push
mfp cordova run
Things i have done via MobileFirst CLI
Create a sampleProject.
Added Android Environment.
Build and deployed the MobileFirst Project.
Now i have the Android-->Native (Folder)
Now how i use this Folder to create my native android App.
i want to build via CMD line.
Edit: if what you're asking is "how to generate the APK for my hybrid application from command line?", then this is not related to MFP.
For a Hybrid application, MFP generates the native folder for you. You then need to use Android tools such as Android Studio or the Android ADT command line to further work with the Android project.
See here: Building and Running from the command line / from Android Studio.
Note that Google's documentation assumes your project supports Gradle, which MFP projects (7.0 and below) do not support at this time. You should probably use the Eclipse ADT UI or Android Studio (do not select to upgrade the project with Gradle support) rather than command line.
These instructions are older (so no mention of Gradle), you can try those.
http://codeseekah.com/2012/02/09/command-line-android-development-basics/
That does not look like a native Android component generated by MFP. It looks like a Hybrid application with the Android environment. Not the same.
To create a native Android component (= the MFP SDK for Native Android applications), you need to generate the NativeAPI and associated artifacts that you then need to copy over into your own, separately created by you (using Android ADT or Android Studio), native Android project.
You can do this using the following set of CLI commands (or via the MFP Studio):
mfp create MyProject
cd MyProject
mfp add api MyAndroidFramework -e android
Read more here: Using CLI to create, build, and manage MobileFirst project artifacts