I am new to mobile application development. I got stuck while creating native application for Android on a Windows 7 machine. I followed the steps below:
I have downloaded Sencha Touch and placed in my local machine (www directory). I also downloaded Sencha SDK Tools to execute all commands. first i executed command: sencha generate app GS ../GS
Created simple program and its running in my browser. (http://localhost:8080/GS)
I have downloaded Android SDK from http://developer.android.com/sdk/index.html and installed in my system. I am here confused what path here need to give.
Open the packager.json file
added: "versionCode":"1.0"
changed : "platform":"Android"
"sdkPath" : "What will be the sdk path. I am getting here confused. I have given C:\Windows\System32 i think this is wrong" // how can i find android path ?
Next i executed command : sencha app build native.
...
...
[info] packaging your application as a native app..
Failed to create android project
... is the error message I am getting.
Where am I going wrong?
sdkpath should contains the location of your android-sdk on your local machine.
"sdkPath":"C:/Users/vksharma/AppData/Local/Android/sdk",// put your android-sdk path here
For more details:
Refer Sencha-2 docs
For finding your android path,follow these steps:
1) Go to start.
2) Type sdkmanager. It will come if android is properly installed. Open it.
3) Below the Menu-bar sdk-path is given.
Refer the snapshot:-
Once you downloaded the Android SDK folder, you have to keep that folder in your local directory.
That is the required path(where you have kept that android sdk folder in your local directory), you have to give in packager.json file.
Related
How easy is PhoneGap to build and deploy Android applications? The application I'm thinking of is not a beginner level app. How is the level of debugging and error handling and the support it gives?
Thanks in advance.
Deploying an app with Phonegap is quite easy. You can install Phonegap by using,
npm install -g phonegap#latest
and then create an app by,
phonegap create myApp
Refer the docs, PhoneGap Getting Started
When you create the app you will notice there is a directory called "WWW". All you have to do is copy a build of your existing web app to this directory.
All your assets and code in this directory will be used to build apps for the platforms you specify.
You can use Cordova to add the Android platform, which will be used to get an Android build out of your project.
Use,
cordova platform add android
Notice the directory "platforms". Inside it you will find another directory called "android" and this will be your Android project.
To build an Android app simply use,
phonegap build android
When you run the above command Phonegap will build an Android project using your code in WWW directory and place it in the platforms/android directory.
You can then use Android Studio to open the android directory which is an Android project now.
It's as simple as that and quite easy once you get the hang of it.
Then you can do all the regular debugging inside Android Studio using Logcat.
I'm trying to make an apk of the web app I made in babylonjs.
From my understanding you can use Cordova to convert a web app into an apk.
I was able to install Cordova and make its hello world apk download to my phone and open and run it just fine.
However my problem occurs when I put all of my web app files into the www folder in my Cordova project folder. After I do that Cordova gives me this error
Error: ENOENT: no such file or directory, stat '/Users/dylan/practiceApk/www/node_modules/.bin/nopt'
when I try to build the android version.
Here is some information about my setup I believe is relevant.
OS: Mac
cordova -v: 7.1.0
Cordova requirements:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-24
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
cordova info also gives this error(similar error I believe to the one above):
Error retrieving Android platform information:
Android SDK is not set up properly. Make sure that the Android SDK 'tools' and 'platform-tools' directories are in the PATH variable.
Error: android: Command failed with exit code ENOENT
But I tried a lot of different things to fix this. Most of them involved making the android tools in the path (er something..?) I also downgraded from the most recent version of Cordova and android. I believe the problem is in my web app node_modules/.bin/nopt
But I don't know why its is a problem.
Also im not sure how this affects it, but I'm not hosting the website anywhere I just assumed I can used Cordova to create the web app as an apk that could be used offline, all resource are in the project folder though.
Any ideas on how to fix this? I only started using Cordova today so I don't know much about it.
Thanks for your time!
Update: I tried building an iOS version and I get the same error. I believe this is an issue with my npm setup...
It seems that when I was copying over my project to the newly made Cordova project folder I also copied the node_modules folder and didn't actually initialize npm. After initializing it and then updating it would build the app.
I am new SugarCrm mobile sdk.
I installed android studio on ubuntu along with mobile sdk from sugarCrm,
When I create a sample project using
"$SUGAR_MOBILE_SDK_HOME/6.1.1.452-1.3.0-2/sdk/generate-app"
I gives no error & create platforms for native android & ios
& than import it in android studio.
On launching app it give error android_assets/www/index.html missing.
When I see it in asstes/www folder, it never created.
Did I miss something or what?
Had to run following command at app's root path to generate index.html along with other required files.
./sdk build --scheme debug --platform android --init-native
Now its working
I am new to ionic and android development.I have created a sample HelloWorld application which works fine in the browser when I try to generate the unsigned APK I am facing the following issues Build Issue Ionic Image Link.I have installed latest android SDK via android studio.These are the screenshots of installed SDKs Installed SDKs Image Link.I have also tried to modify the environment variable Android_Home path to 'C:\Program Files (x86)\Android\android-sdk\build-tools'.Still facing the same issue.
FYI: I am using Windows as my development environment.
Ionic thinks your Android SDK is at the file path 'C:/Android' because it found adb there. It's definitely not there because 'platform-tools' isn't there. Try deleting that file (or folder if you don't need it) and changing your ANDROID_HOME path variable to the location that Android Studio says your SDK is at. If you navigate to that folder yourself you should see a 'platform-tools' folder there.
Helo,
I am currently trying to build the base phonegapp android app that's automatically created, so I navigated to the directory... but when I use the command
phonegap build android
I just get this random error, as shown in the attatched picture.
Extra info
I am currently on Windows 8, and am completely new to making apps, and am new to the command line as well. Not very familiar with this stuff...
What I'm trying to do would be called 'compiling', right?
Yeah, I had the same problem yesterday - but with a little help of a colleague I got it!
Step by step tutorial (for Windows)
Install node js
Install phonegap using command line: npm install -g phonegap
Install Android SDK
Launch Android SDK Manager and install Android 4.4.2 (API19)
Because latest phonegap/cordova version requires this
Documentation for Android SDK and SDK Platform should be enough
Also update already existing packages
Create an environment variable called ANDROID_HOME which points to destination of Android SDK. e.g. C:\Users\You\AppData\Local\Android\android-sdk
Download Apache Ant and extract the archive somewhere
Create an environment variable called ANT_HOME which points to destination where you have extracted Ant
Install JDK (Java Development Kit) for your System. Before you are able to download, you have to accept the licence
Create an environment variable called JAVA_HOME which points to destination of JDK
If you want to add plugins via phonegap automatically you should also install GIT.
Last but not least you need to add the following directories to PATH environment variable:
%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin
Each folder is separated by a semicolon
Setting environment variables will take effect just for new command line windows. So you should reopen it, after the whole process.
Easy, isn't it? ;-)
Now you can use phonegap build android after you've created a new phonegap project. If you have your smartphone plugged via USB and installed the USB drivers, and activated the USB Debugging on smartphone, you may use
phonegap run android
And the ready build APK will be transfered and executed on your smartphone. Perfect for testing.
If you want to create a final release APK, go to
YOURPROJECT\platforms\android\ant-build
and enter ant release.
You'll find the final APKs in YOURPROJECT\platforms\android\bin.
They are unsigned, here is a Noob guide to signing an APK.
I have tested a Barcode Scanner example, and it works seamlessly.
Have fun!
also check android in cmd, if it says: 'xcopy' was not recognized.
then add to your path:
%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;
Armin's guide is perfect. But if you still fail you can do this.
Phonegap platform files stay in C:\Users[username].cordova\lib folder. Go there and remove android/ios/bb... driectory.
For best result run this command:
npm cache clear
After that try again, clean platfrom files will be download and build your project.