unable to generate apk in ionic framework issue with android sdk - android

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.

Related

Flutter setup: transfer android Sdk from device to another

I am trying to setup Flutter on my friend's device and ,After I ran flutter doctor the Android Sdk was missing and i want to transfer the Sdk from my device to his without downloading it ,
How can I do it?.
also i tried moving the flutter Sdk and it worked so i hope that there is a way to do the same with android Sdk.
It worked.
What I did: I copied the whole Android folder that contains the SDK and pasted it on my friend's device. I had to copy the the JDK folder to his device and set the Java_home path for it. Afterwards, when I ran the Flutter project, it started downloading the Web SDK (I did not know how to copy it) and it ran Gradle Task AssembleDebug to create The .gradle folder in the C:\Users\Username section. I did not try to copy that folder, but it may work.

How to fix 'Android SDK not found at this location' error while installing flutter?

I'm installing flutter in my Ubuntu 18.10. I'll be using Visual Studio Code for flutter development. I've not installed Android Studio.
I've downloaded Android Command line tools from official android site and extracted it in a separate folder in Documents/development/android
I set the path for ANDROID_HOME in the bashrc file by following the flutter documentation
Here is the .bashrc file
And the Android toolchain error
It seems that , you set the ANDROID_HOME variable but it is not added to PATH.
Make sure you add the ANDROID_HOME to the path as below
export PATH=$PATH:$ANDROID_HOME/bin
and re-launch the console.
update
In order for Android SDK to work fine, you need to set path for the below SDK packages.
..android-sdk\tools
..android-sdk\platform-tools
and your ANDROID_HOME will be
..android-sdk
I am not sure what you are referring to when you are saying that you have downloaded Android Command Line tools. From the output in your terminal, it tells me that you do not have the SDK files in your machine. To download the Android SDK, please see this link here and download the tar file that matches your operating system. Then extract the tar file in the folder which you have set as ANDROID_HOME. This should work fine.
In case you are having the same error, I strongly recommend downloading the Android Studio and install the Android SDK through the Android Studio. The flutter documentation says so as well. You can always uninstall or remove Android Studio after it is being installed and if you are not considering using it.
please replace yout android sdk in thatway this is default installation location of sdk C:\Users\Intel\AppData\Local\android\android_sdk

Cordova Web App

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.

To add android in phonegap platform using cordova [duplicate]

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.

Sencha touch : How to make native application for android on window7

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.

Categories

Resources