phonegap platform not working android - android

You can see I have SDK tools installed and the SDK platform installed.
I have no clue why I am getting the error below in the CLI?
I have already created the app, I following http://cordova.apache.org/docs/en/3.1.0/guide_cli_index.md.html#The%20Command-line%20Interface getting to the platform add step I am failing miserably. Maybe I don't have the android command ? If so how do I do that?
Is it because of administrator access(if so, how do I fix that), is it a path issue(again how do I fix it)?
I installed ant then I went into C:\Users\visum_000\.cordova\lib inside there I deleted the android folder, then tried the command again, here is what happened.
You see it downloaded but still gives the error.

It actually looks like you have installed the Android SDK properly on your box.
Have you adjusted your Path settings and added the Android tools path accordingly ?

Related

Error about Android Studio on Macbook M1: An error occurred while trying to compute required packages

I've downloaded Android Studio from the official website, the one for M1 chip (arm).
Basically running it for the first time, the error is the following:
An error occurred while trying to compute required packages
I was searching about it the whole day to figure out a way to make Android Studio work, but that error keeps showing. Not completely sure if it's related to M1 Macbook, as on my Intel one it works as expected.
What I already tried to do:
Installing the command line tools, then placing it on SDK folder (Users/user/Library/Android/sdk). Then added the bin to the PATH (Reference)
After doing that, when executing the sdkmanager on terminal I get the following message Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
Then I searched again and it leaded me to this thread, then as on the answers I tried to rename the folder, then other tries not related. I fell into many links and references that did not work at all.
After that I try to check what happens if I click on New Project, then the following is shown:
The Android SDK location cannot be at the filesystem root
As the message indicates, the issue is The Android SDK location cannot be at the filesystem root, so I searched again about it
I looked into that and got to a few links, for example this one and this one. Before doing that search I clicked on the Edit button, which lead me to the Android SDK to be updated/installed (Nice!), so I had to delete the content I had on Android folder (inside Library) and clicked next...then, I got the same message An error occurred while trying to compute required packages.
Then I thought "ok, maybe if I change the SDK location", so I changed to ../Documents/sdk, which ended up in the same result
Seems like no matter what I do, it ends up showing up that same message.
When I run java -version that's what I see:
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)
Did anyone have the same issue? Am I doing something wrong? Not sure how to proceed from here, despite of the Android Studio version I download it's always the same result.
Any help is appreciated.
This is what solved it for me on my M1.
Go to Android Studio Preview and download the latest Canary build for Apple chip (Chipmunk). Don't worry this is just to get through the initial setup.
Unpack it, run it, let it install all the SDK components, accept licenses, etc as usual.
Once it's done, simply close it and delete it.
Now when you start your stable Android Studio (Arctic Fox) you should not see the error.
I tried over a dozen 2021 stable and Canary builds from https://developer.android.com/studio/archive and couldn't get any of them to work.
This is the only thing I could find that worked:
Download, unpackage and run Android Studio 3.6.3 android-studio-ide-192.6392135-mac.zip from here.
Proceed through the initial setup and let it download and install the SDK. Ignore any errors at the end.
Delete this version and open the stable Android Studio like normal.
You can now proceed through setup!
I also faced this issue a couple days and I changed my mind to not use Android Studio. And It's fixed!
My alternative option is to download IntelliJ community edition and install Android SDK to your machine.
Image for IntelliJ Download Page
After (IntelliJ) installation is complete,
You need also to create new project, select android then download SDK. (thanks for #SteveRoger 's comment)
then open Android Studio again and follow its setup wizard. It will show that my machine has been already installed Android SDK and it can run perfectly at this time.
Hope this is an alternative solution for you.
Have a great day.
I solved the problem with these steps:
Install the old Android Studio 3.6.3 (find the old Android Studio at https://developer.android.com/studio/archive)
Install the Android SDK
Overwrite the installation with the Apple Chip version of Android Studio
I had the same problem with my MacBook air(m1 chip) as you mentioned.
How did I solve it?
Just download the IDE - Intellij IDEA and create a new project, select Android Project and there download Android SDK, now you can install android studio again and the sdk is installed.
I've also had this exact same issue when downloading Android Studio 7.0.3. Here's what helped me.
Download the command line tools, place them in the SDK folder (e.g., on mac: /Users/user/Library/Android/sdk), and then add the bin folder to the PATH.
Install the latest platform: in a terminal, execute ./sdkmanager "platforms;android-31"
Next up execute this command ./sdkmanager --channel=3 emulator (this switches the channel from stable=0 to canary=3 )
Open Android Studio, and go to the SDK Manager (Appearance and Behavior > System Settings > Android SDK)
Click on "Edit", and then select the sdk folder. Then "Next" > "Next" > "Finish".
Now restart Android Studio and everything should work
I had the exact same error as OP. Follow what Art Fedorychak mentioned, it worked for me as well. It seems like the current stable build of the Apple M1 android studio version doesn't actually initialize an SDK if one doesn't already exist, but it seems to be able to update and or / initialize one that does as long as the same folder is being referenced, so we just need to use a working SDK for M1 on the initial run and then revert back to the stable AS
This is what solved it for me:
Download & install IntelliJ IDEA. https://www.jetbrains.com/idea/download/#section=mac
Open IntelliJ IDEA and create New Android Project
Download sdk success
Open Android Studio & checked it worked
My solution to this problem is simply to put the SDK in another location. For myself, I put the SDK folder to subfolders in Documents. The SDK download will initiate.

Can’t install android SDK platforms and SDK tools

Recently I have installed Android Studio 3.0.1 and SDK on my windows 10 computer. But I am encountered with the following problems to start my Project.
When I create my first application the following error message was displayed
Error: Failed to find target with hash string 'android-26' in: C:\Users\username\AppData\Local\Android\Sdk Install missing platform(s) and sync project
I tried to download and install the missing Platform online but after finishing the download and try to install the platform, nothing is changed, rather the download starts again and SDK manager is still empty. Even though the error message says failed to find the path 'android-26', it is already created in the ‘platform’ folder of SDK path with all necessary files.
Another Problem is the SDK manager is empty, the content that is going to be installed appears only when it is connected with Internet and it disappears as soon as I go offline.
What is the problem? I have been searching everywhere for answer but with no success. If there is a way I would prefer to download all the necessary files and then install them offline because every time I try to install them online either the speed is very slow or the download interrupts.
you can try this ways :
1-check your sdk path.i think your sdk path is invalid
2- clear your sdk and download sdk from this link
https://dl2.soft98.ir/mobile/Android.SDK.Release.25.2.5.Win.rar?1519592698 and change your sdk path from android studio. its worked for me

How to resolve issue with my Gradle file in Android Studio?

After reinstalling my Android Studio I have big issues because all my projects have problem with Gradle file.
There are .jpeg-s attached
Gradle File
Messages Gradle Sync
[Some conflicts in installation area][3]
I would suggest fresh new install of everything and keep in mind where exactly will you install it (my suggestion would be to keep it simple like C:\Android\ for studio and C:\Android\SDK for SDK
Also you can click on Edit next to the SDK location and see what if your SDK report any issues or you can select another SDK location and update missing tools from there.
Or if you would like to tackle current issue on another way, use search and find SDK folder and move it your android folder (don't forget to avoid black space in file path), and again through SDK location don't forget to put new path to the Studio.
After you set up your environment ans run your build gradle again there shouldn't be any more issues like this, or at least when you install missing platforms and tools it will fix thing as it should.
Also have the same dependency version for libraries when you finish setting up environment.
Finally done. I resolved uninstalling Android Studio. The real problem was SDK. When you uninstalling AS SDK is still on computer, and I deleted all these files from SDK folder. The best option if you install AS and SDK directly on C:. After that AS working without any problems. Thanks #Miroslav for all your help and patience.

ionic not finding android

I have tried to use ionic lab. I tried to build a simple blank app using the lab but when I go to build my android app it says I need to have android sdk. I have android sdk and the platform tools already. I even added to my path in case you were wondering. I was graciously sent here to ask for help after trying to research my issue by looking at "ionic android build error - failed to find android_home".(which was when i checked my environment path). I took a screen shot of both(environment and error from ionic lab console). error and
environment
For windows:--
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
The Android SDK download does not include specific Android platforms. To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.
Open the Android SDK Manager window:
android
Note: If this command does not open the Android SDK Manager, then your path is not configured correctly.
Select the Tools checkbox.
Select the checkbox for the latest Android SDK.
From the Extras folder, select the checkbox for the Android Support Library.
Click the Install packages... button to complete the download and installation.
Note: You may want to install all the available updates, but be aware it will take longer, as each API level is a large download.
Could you please do following stuff in terminal. It might be helpful for you.
Step:--1
export ANDROID_HOME=~/android-sdk-macosx
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
Step:--2
Update SDK and go to directiory and set your SDK path properly.

Cordova-CLI & PhoneGap-CLI do not see android sdk

I've created app with "phonegap create" command. Then I switch to project dir and try to run it with "phonegap local run android" and I have next error message:
Please install Android target 17 <...>
Android SDK is placed to C:\dev\sdk
My PATH variable contains C:\dev\sdk; C:\div\sdk\platforms\;C:\dev\sdk\platform-tools
I run "android" command from cmd and SDK Manager shows no updates or no missed sdk files.
I tried create and run project with cordova cli but had same problem.
What can it be?
It seems that for latest Cordova (3.0.6),
cordova platform add android
command only recognize Android 4.2.2(API17) SDK. After I install the API17 SDK, the error was gone.
Not sure if there is a cordova command option that can specify SDK version.
I had just the same problem (error message) with os x (10.8).
After executing the command android in the Terminal some android-packet-management-UI popped up. There i could install stuff that made it run ..
I had API17 installed but was still getting this error.
I needed to install apache-ant, set ANT_HOME=C:\Program Files\Java\apache-ant\, JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21\ and add both bin's to my PATH += C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\apache-ant\bin
See https://stackoverflow.com/a/13986997/956397
I had the same problem and the very most simple way to resolve it is changing the target in project.properties to 16 and try.
it seems if you type "android" at the same command prompt you type your cordova commands, you get a separate Android SDK manager then the one launched via Eclipse and so then there you select the appropriate packages and updates to achieve the version number of the Adroid SDK required. For me I'm guessing it's from an adt-bundle I installed with _? (I don't know actually no clue) that runs instead.
My best guess is the installer when updating doesn't doesn't update the path correctly.
Ya you need to manually correct duplicates and anomalies in the path.
Point to the "sdk" folder and tools of a valid most current adt-bundle-windows folder.
Maybe it was NetBeans that did this?
No it seems plausible when I put an update of Eclipse (C:\Library\Dev\Android\adt-bundle-windows-*) I must have not realized I needed to update the path too having done it manually the first time to get it to work.
It seems I needed plateform-tools added as well for adb to run the emulate command...
C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\Library\Dev\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools;

Categories

Resources