Install cordova plugin once imported to Android Studio - android

I'm trying to install a cordova plugin to a project which has already been imported to android studio.
If I run:
cordova plugin add wifiwizard
It says:
Current working directory is not a Cordova-based project.
How do I correctly install this plugin, without having to start again?

First you have to create a Cordova project
cordova create nameOfProject
Then you go to this project (cd nameOfProject) and you add in this folder the plugin you want as you did it.

Related

how to run moodle mobile app on android studio

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

Gradle version to use with Android/Cordova CLI

I currently use Cordova CLI on Windows to build hybrid Android apps. I am in the process of moving my development mover to a headless Ubuntu server. Getting java, NVM, Node, Android SDK and Cordova CLI installed on Ubuntu has not been a problem. Having done so and created the customary Cordova hello world project,
cordova create hello com.example.hello HelloWorld
I proceeded to add the Android platform
cordova plaform add android
and then attempted to build
cordova build android
at which point I was told
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Installing Gradle by following the instructions given here - I am NOT installing Android Studio and am working on a headless Ubuntu machine so automatic Gradle installation is not an option - is not a problem. However, it is not clear to me which version of Gradle I should install.
I do not want to break my current Cordova project so I am trying to replicate the current Windows/Cordova CLI setup as closely as I can
Node 8.9.2
Java 8
Gradle ???
Dipping inside the gradle-wrapper.properties file in my existing project I find
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
I have noted that when I compile the project at present there are some ominous warnings about features to be removed from future versions of Gradle that are shown. I could experiment with using gradle-2.10 but it is not entirely clearr to me that it would indeed be the right version. Hopefully, someone here will be able to point me in the right direction.
First, clean up the project
cordova clean android
Then, force the cordova to use the distribution url with the version you want, in this case: gradle-6.3
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https\\://services.gradle.org/distributions/gradle-6.3-all.zip
Then, build your application.
cordova build android --release

Cordova: Cannot find module './android_sdk'

I checked out a Cordova project from SVN in IntelliJ Webstorm. When I try to run it on an emulated Android device, I receive the error message:
Error: Cannot find module './android_sdk'
All the other people working on the project can run the project fine. And I can run every project that I have created locally.
in my case (Kubuntu 16.04.2, Ionic 3.3.0, Cordova 7.0.1) i just did this:
cordova platform rm android
cordova platform add android
and that did the trick :)

How to upgrade from phonegap 2.9 to phonegap 3.5 (project directory could not be found error)

I have an android application that i built on PhoneGap 2.7.I installed phonegap 3.5 using cmd and tried to upgrade an app as shown here
How do I upgrade Phonegap in my Phonegap app?
But when i do it using cmd it gives me the following error:
Unlike phonegap 3.5 the android application that I built in PhoneGap 2.7 does not have a platform folder.So what am I supposed to?and how can I verify if it is upgraded or not?
I had also seen these phonegap documentation
http://docs.phonegap.com/en/3.5.0/guide_platforms_android_upgrade.md.html#Upgrading%20Android
But It does not show how to directly upgrade from 2.7 to 3.5
I don't think phonegap platform update works for upgrading from something older than 3.x.
For phonegap/cordova cli to work it has to detect a project with the structure of 3.x projects.
To upgrade your project in 2.x you have to
install phonegap or cordova cli (which you seem to already have done, but if you don't plan on using phonegap build, I suggest you use
cordova instead of phonegap. if not please replace cordova by phonegap
in next steps)
open a cmd and cd to a folder in wich you will want to put your project
create the new project from the www folder you had in your old project:
cordova create nameforprojectfolder com.test.app Testapp --copy-from=pathtooldwwwfolder
change current dir to the newly created folder
add the android platform:
cordova platform add android
in cordova/phonegap 3.x no plugin is added by default so you will have to add all the plugins you use :
cordova plugin add uri.of.plugin
customize config.xml to your needs
build the android project (this will create files in the platforms/android folder)
cordova build android
You may need to customize AndroidManifest.xml in platforms/android/AndroidManifest.xml
Now you can use the CLI to work with your project.

How to configure jenkins with titanium studio to work?

I want to develop a mobile application with titanium. Before starting I should first configure SVN and jenkins with titanium studio. I have already installed a plugin svn: subversion plugin on jenkins server plus another plugin named Eclipse plugin on titanium studio. Now I want to configure titanium with jenkins. I searched jenkins plugins available and I found a plugin called: android lint plugin.
Is what I must also install it?
Configure your repository in jenkins (SVN, git..) and install the Titanium CLI.
Add a buildstep to the Jenkins buildprocess for this project, which invokes a script in the Titanium folder. Perhaps you need to unlock your mac keychain before starting that build script, for more information have a look at http://www.egeek.me/2013/02/23/jenkins-and-xcode-user-interaction-is-not-allowed/ . If you combine the call of the build script with the unlocking, everything will run fine automatically.
The build.sh contains the call for the Titanium CLI:
titanium build --force --developer-name "YOURDEVNAME" --pp-uuid "YOURUUID" --platform ios --build-only --target device --device-family universal
This will build the project and create a .ipa in the folder build/iphone/build/Debug-iphoneos/

Categories

Resources