Xamarin Forms Build Failing: Missing dx.jar - android

I am trying to build a Xamarin Forms 3.4 solution but am getting the following compilation error:
Unable to access jarfile C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\\lib\dx.jar
The folder in question only contains the following files:
apksigner.jar
d8.jar
shrinkedAndroid.jar
I opened the Android SDK Manager and can't see any installed platforms or tools. I get the error:
Loading SDK component information failed. Please retry.
This solution built just fine last time I worked on it. I'm thinking of re-installing Xamarin but that feels a little dramatic.

Here is what you can do: -
Open the Android SDK Manager with another version of Visual Studio (2022).
Go to Tools Tab > Android SDK Build Tools and uninstall the 32.0.0 version.
This will allow your project to pick another version with the dx.jar file. Install version 30.0.2 if you don't have it already.

Related

Android build tools not detected

I am developing Android application using Ionic framework (Ionic is built on top of Apache Cordova). When I try to build my app, I get an error, which states that build tools are missing.
Error:
> No installed build tools found. Install the Android build tools version 19.1.0 or higher.
I am using windows, and I have Android SDK tools installed (at C:\tools), also I have used sdkmanager to install platform-tools (at C:\platform-tools) and android26 and android27 platforms (at C:\platforms\android-26 and C:\platforms\android-27).
My ANDROID_HOME enviroment variable is set to C:\tools and I have included all of the following locations in my path:
C:\tools
C:\tools\bin
C:\platform-tools
C:\platforms
I believe I am missing something, what do I have to do/fix for my build to succeedd. What are those build tools that I do not have installed?
You have set "ANDROID_HOME" to your sdk tools folder. This is causing an error in the relative navigation used by Cordova.
Solution: Create a new folder "SDK" in your C drive as such C:\SDK. Now add all of the sdk stuff into that directory. Finally, change your "ANDROID_HOME" path to C:\SDK

Error for SDK tools Android Studio

I've started to learn to make Android apps recently but I've faced a problem in launching Android Studio!
I downloaded android studio and also downloaded SDK tools from here ( I downloaded them separately ) and when I give SDK path to the Studio, it installs SDK successfully but when the project opens, it says that some Android SDK tools are missing!
Error :Gradle sync failed: Failed to find target with hash string
'android-26' in: E:\android-sdk
I'm confused because I can find no problem in my downloading and installing but there is an error!
What should I do?
install android studio and sdk also( not separately) then create a new project and build them, and if it work then, you can move your sdk file and then connect the path your sdk.
i think you tried separately and some how any data are being missing .

Visual studio Cordova - Could not find gradle wrapper within Android SDK. Might need to update your Android SDK

I have a cordova project in visual studio. When running the app onto a device the error
Could not find gradle wrapper within Android SDK. Might need to update your Android SDK
keeps popping up. I have android studio, android sdk(updated) installed. The adb is working and detecting my device all fine. I have searched a lot and most of the answers that i have found are telling to download the sdk once more. But i already have it on my machine.
Visual studio is looking for the gradle wrapper in the location
path-to-sdk\tools
folder. So what i did is copied the template folder from
C:\Program Files\Android\Android Studio\plugins\android\lib
and pasted that folder into the above sdk tools folder. Re-ran the project. Fixed it.

Could not find gradle wrapper within Android SDK. Might need to update your Android SDK [duplicate]

This question already has answers here:
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android
(24 answers)
Closed 5 years ago.
I am trying to take build in an ionic2 application. I got this error while running ionic build android. The error log is
ANDROID_HOME=/home/varun/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /home/varun/Android/Sdk/tools/templates/gradle/wrapper
I tried updating the sdk but it was found that the sdk version is latest.
When i looked at the Android/Sdk/tools folder there is no templates directory. I am running on ubuntu 16.04, with cordova version 6.5.0
Edit:
There has been a newer release of Cordova Android that also fixes some problems with SDK tools 26.x.x
cordova platform update android#6.2.2
or
cordova platform rm android
cordova platform add android#6.2.2
Old answer
Google broke Cordova Android 6.1.x and some other frameworks with their latest sdk tools update.
Cordova Android 6.2.1 has been released and it's now compatible with latest Android SDK.
You can update your current incompatible android platform with cordova platform update android#6.2.1
Or you can remove the existing platform and add the new one (will delete any manual change you did inside yourProject/platforms/android/ folder)
cordova platform rm android
cordova platform add android#6.2.1
You have to specify the version because current CLI installs 6.1.x by default.
I resolved by this by replacing the tools folder in my Android SDK with an older version of the SDK tools (r25.2.3). Follow these steps to do the same:
Navigate to https://developer.android.com/studio/index.html, click "Download Options", scroll down, and download the command line tools package for your platform, ensuring that you get a version in the r25.2.X series (not r25.3.X).
Unzip this folder. You should end up with a tools directory.
Navigate to your $ANDROID_HOME directory (~/Library/Android/sdk/ on OS X).
Rename the pre-existing tools directory there to tools.bak (e.g., mv tools tools.bak)
Move the tools directory you just downloaded into the SDK folder (e.g., mv ~/Downloads/tools/ .)
A new major version of the SDK tools was just released, which appears to be causing some issues with Ionic (see the press release here: http://tools.android.com/recent/androidsdktoolsrevision2530feb2017).
This worked for me
cordova platform update android#6.1.2
There's no need to downgrade Android Tools.
On Windows gradle moved from:
C:\Users\you_username\AppData\Local\Android\sdk\tools
to:
C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper
So you just need to ajust your path so that it points to the right folder.
I had same problem and I solved it with Carlos Delgado's answer.
Android Path must be set before all things below.
Download the latest command line tools (https://developer.android.com/studio/index.html -> very bottom part)
Unzip -> copy and paste "tools > templates" folder to your project folder (/Libraries/Android/sdk/tools/)
press option key to see Libraries folder in your Finder

Android Config in Eclipse - SDK Preferences wants ...\Platforms, but SDK doesn't come with one

I'm installing and configuring Eclipse Galileo 3.52 on a PC following the instructions on Eclipse ADT
All the steps in "Downloading the ADT Plugin" go fine with no errors. But when I get to the next step "Configuring the ADT Plugin" it fails when I set my SDK location, saying that it can't find android-sdk-windows\platforms.
But no kidding - I'm using the android-sdk_r06-windows SDK and the Readme file says, "The Android SDK archive now only contains the tools. It no longer comes populated with a specific Android platform or Google add-on. Instead you
use the SDK Manager to install or update SDK components such as platforms,
tools, add-ons, and documentation." How how I do this? Do I have to use an older version of the SDK to go with this older version of Eclipse?
Thanks in advance.
To QRohlf:
I tried that. I ran it from the command line and got the same error:
[INFO] Starting Android SDK and AVD Manager
Error: Error parsing the sdk.
Error: C:\Documents and Settings\Peter\My Documents\SW\AndroidSDK\android-sdk-windows\platforms is missing.
Error: Unable to parse SDK content.
"platforms" is missing because it's not included in this version of the SDK. It says so in the Readme file. I'm trying to follow the instructions in the link in the original post which imply this can be all done from the IDE but I don't know what step is supposed to create the platforms folder.
It's tempting to manually create the folder but I want to do this 'by the book' as the Eclipse/Android team intended because I'm making a 'getting started' guide for some students.
I redid my installation from scratch but this time I put the SDK higher in the file system - C:\SDKs\AndroidSDK.... and this time it was happy.
I don't know if it was having a problem with the long pathname or the space between "My" and "Documents" or what, but the issue is now resolved.
Run the Sdk Setup.exe in android-sdk_r06-windows and install the addons. See Adding SDK Components for detailed instructions.

Categories

Resources