Please do not mark this questions as a duplicate - I have diligently searched SO for a satisfactory answer and have found nothing that worked for me.
I downloaded the very latest version of the Android Studio and attempted to install it on two Windows 7 PC's - a laptop and desktop with identical configurations of JRE and JDK. Results:
laptop: can use Android Studio to build/run first Hello World app; everything seems fine.
desktop: Hello World builds successfully, but will not run. Reports gradle error:
:app:preDexDebug
The system cannot find the path specified.
I have spent 3 days now researching this error on SO and elsewhere and have tried everything suggested (edit dx.bat, edit find.java.bat, JAVA_PATH, gradlew --stop etc) but nothing works for me.
Configuration:
- Android SDK Tools 24.0.1
- Android SDK Platform Tools 21
- Android SDK Build Tools 21.1.2
I am on the verge of giving up on my desktop installation of Android Studio.
Any new suggestions?
Please help!
This has something to do with an error in your Gradle build process. You'll need to clean the project and rebuild to fix this. An easy way to do this is from the root folder of your project run ./gradlew clean
Related
I have looked EVERYWHERE for the solution to this.
Ionic Cordova Build Android No installed build tools found did not work
cordova build android failed with exception was a ridiculous non-answer. OF COURSE Android Studio is installed!!!
Android studio- "SDK tools directory is missing" I did this. The $ANDROID_SDK_ROOT/tools folder now exists, but that didn't solve my problem.
I tried the advice given here: Ionic Cordova Build Android No installed build tools found and all I get when I run sdkmanager packages "build-tools;30.0.3" is "failed to find package 'packages'" from the SDK Manager.
I looked here: Android SDK Manager does not exist and installed ALL the stuff they said to install -- including the obsolete packages. And still no luck.
Here's my path:
/opt/homebrew/bin:/Users/lmacneill/.sdkman/candidates/java/current/bin:/Users/lmacneill/.sdkman/candidates/gradle/current/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/lmacneill/CordovaProjects/gamapp/node_modules/.bin:/Users/lmacneill/Library/Android/sdk/tools:/Users/lmacneill/Library/Android/sdk/build-tools:/Users/lmacneill/Library/Android/sdk/platform-tools
Here's my Android Studio SDK Platforms screen:
https://i.stack.imgur.com/2e5YI.png
And here's my Android Studio SDK Tools screen:
https://i.stack.imgur.com/btLIR.png
(Unrelated to this post, but very weird -- it told me I needed 10 reputation to post images, yet I have 661 reputation. Why did it do that? Hence the link to my images instead of the actual images.)
SO WHY CAN THE TOOLS NOT BE FOUND?!!!!!!. I've done EVERYTHING that EVERYONE has suggested, and STILL IT DOESN'T WORK!!!!
This is ridiculous!!!! Surely someone must know the answer?
Well... I FINALLY figured it out...
In the $ANDROID_SDK_ROOT/build-tools folder, there was a 33.0.2 folder. So in my .zshrc file, instead of adding $ANDROID_SDK_ROOT/build-tools to the path, I needed to add $ANDROID_SDK_ROOT/build-tools/33.0.2 to the path.
Then cordova build android FINALLY worked!!!
BTW, I figured this out when I finally got sdkmanager to install the build-tools;30.0.3 -- you have to use sdkmanager "build-tools;30.0.3" command, NOT the sdkmanager packages "build-tools;30.0.3" command. Maybe the command with the 'packages' bit worked for an older version of sdkmanager? But it definitely doesn't work now. Anyway, once I saw that it had created a new folder in $ANDROID_SDK_ROOT/build-tools, I finally realized that exporting only $ANDROID_SDK_ROOT/build-tools in the path wasn't enough. You have to include the version folder in there as well.
ANDROID!!! Y'ALL SHOULD MAKE THIS EASIER!!!! INSTALLING ANDROID STUDIO SHOULD DO ALL OF THIS STUFF AUTOMATICALLY!!!!!
I am new to Xamarin for visual studio , when I tried to build the auto generated app from visual studio 2015 without any editing it just did not build and those errors occurred :
*Severity Code Description Project File Line Suppression State Error The file "obj\Debug\android\bin\packaged_resources" does not exist. App1
*Severity Code Description Project File Line Suppression State
Error "aapt.exe" exited with code -1073741819. App1
I tried many solutions from those who had the same problem but I can't seem to find any solution that actally works for me.
One additional detail that is not mentioned but might be a part of the problem is that the resource files can only contain 'a'-'Z', '0'-'9' and '_' characters. A single resource file can ruin the whole build, which is exactly what happened to me. I suggest to anyone running into this mistake to double check the file names of resources.
Same problem with me. It seems it´s a bug.
Lots of posts out there:
https://forums.xamarin.com/discussion/65862/i-cant-build-any-android-project
At this one I´ve seen a light and worked for me:
https://bugzilla.xamarin.com/show_bug.cgi?id=39910
In short:
Close VS
DEL your folder C:\users\\appdata\local\xamarin
DEL your project sub-folders BIN and OBJ at Droid and IOS
Use Nuget to update your projects packages
Update Android Studio SDK if neccessary
Reopen VS and rebuild your solution.
I hope you have same luck... It was really annoying...
Please let us know. Bye.
Ran into the same problem. After toiling on it for a while, I finally found a viable solution. Apparently, this is like caused by a bug in Android Build Tools 24.0.0. And removing those from the system should solve the problem. A bug has been reported, you can find more details on the link below:
https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/
Installing an older "Android SDK build tools" Version was the solution for me.
Start the SDK Manager (in VS 15):
Tools -> Android -> Android SDK Manager ..
Install "Android SDK Build-tools" version 23.0.1
Uninstall all other "Android SDK Build-tools" versions
Build -> rebuild the project / workspace
(Even safer: run a clean, restart VS, run build)
This was successful with:
Android SDK Tools 25.2.3
Android SDK Platform Tools 25.0.1
Android SDK build tools version 23.0.1
If that works, you can test newer build tools.
I'm trying to build Terminal Emulator for Android. I'm running Android Studio 1.4 in Kubuntu 15.04. I also tried building it in Ubuntu 14.04 LTS with the same results. The project requires the latest Android NDK, SDK 22, and SDK 11 which I've downloaded and configured in Android Studio. My system gradle version is 2.8, and Android Studio has downloaded some other versions internally. I'm using jdk1.8.0_65, which is set to JAVA_HOME and configured in Android Studio. I've built several other projects with my configured Android Studio and only seem to have a problem with this project. I need to use this project as a base for an app I'm developing.
I end up with same error, posted below, no matter what route I take to fix it in Android Studio. This is generally what I've done to try and get the project to work. I open up the project unmodified in Android Studio. I click Build >> Rebuild Project. I get an error telling me ndk implementation is deprecated. I add a file gradle.properties to the root directory of the project with the line android.useDeprecatedNdk=true and rebuild. It gives me an error: Task 'generateDebugTestSources' not found in project. I execute Sync Project With Gradle Files to resolve it. Then I end up with the following error and can't get past it.
Gradle 'Android-Terminal-Emulator-master' project refresh failed
Error:exception during working with external system:
or
Gradle sync failed: exception during working with external system:
Consult IDE log for more details (Help | Show Log)
idea.log
Things I've done to try and get the project to build:
Modify all of the project's build.gradle files to use the experimental plugin
Use different versions of Android Studio
Switch from openjdk to Oracle's jdk
Upgrade gradle to the latest version
Set gradle to default wrapper (default) and also set gradle to different versions
invalidate cache, remove ~/.gradle, and rebuild project
Make sure PATH includes the gradle and jdk bin directories and is in ~/.bashrc, ~/.profile, and ~/.zshrc
remove proguard from libtermexec library
reboot computer
I should note that the project builds without issue on the command line. I'd really like to get the project to build in Android Studio for development.
Install Arch and run Android Studio there.
I decided to try building Terminal Emulator on my Arch server, so I installed a xfce (Desktop Environment) and Android-Studio through pacman. I followed the same general path to get things setup, and the app built without issue.
The idea log Android Studio generated for the failed build on Windows and Ubuntu didn't point to any clear problem, even with --stacktrace enabled with gradle. I'm not going to waste my time figuring out why gradle doesn't want to build apps in Ubuntu or Windows.
I used Visual Studio 2015 to develop mobile app with Cordova. Before I upgraded to Windows10, I was using Windows 7 and it worked perfectly fine. After I've upgraded to Windows10, whenever I open a Cordova project or create a Cordova project the Visual Studio hangs (not responding).
I have tried to reinstall the Visual Studio but it still hangs.
Anyone has faced this problem before?
Thanks
Here is the solution for this problem in VS 2015. This issue if you have Windows 10 and latest updates in VS 2015 including latest type script installation.
1) Open command prompt as administrator.
2) Navigate to the following folder path:
cd "C:\ProgramData\Package Cache"
3) write the following command to find out vs_edition.exe file:
dir vs*exe /s /b
4) copy the full path that contains your vs edition exe from the screen.
5) write the following command:
"C:\ProgramData\Package Cache\{GUID}\vs_enterprise.exe" /modify /installselectableitems Javascript
6) VS installer will start, click on modify and then update. no need to change any features selection.
7) Wait until the installer finishes.
8) From the command prompt, navigate to the following folder:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
9) Run the following commands:
devenv /updateconfiguration
devenv /clearcache
Below screenshot shows the full commands set.
Now, you will be able to open VS 2015 and create cordova apps.
This is a known issue, and the solution is mentioned in the following link.
I still had few more issues with the Blank Cordova Project which would simply not build once the hanging issue was fixed. I'll share my experience here to help others.
After recovering from the VS.Net2015 hanging I was still getting
"Error MSB3073 The command "platforms\android\cordova\clean.bat" exited with code 1. BlankCordovaApp7 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets 354"
I tried reinstalling the Android Studio again and found that it was not working, and the issue was: I had installed a 32 bit Java SDK on 64Bit OS. After In installed the 64Bit JDK and correcting the Path variable to point to this directory, I was able to start the Android Studio.
Now my Blank Cordova project was still not compiling with an error
'MySQL' is not recognized as an internal or external command, BlankCordovaApp7 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets 287
This was an interesting one, looks like its an issue with MySQL, in the PATH variable there were some & within the path. I used "" to surround those path
Now its compiling and also able to start the Ripple.
Hope it helps someone as it took me more than 2 weeks to fix.
Regards
Kiran
Today , solved for me with Visual Studio Tools for Apache Cordova Update 2 for VS2015 Enterprise & Windows 8.1. ;-)
I think there are some updates for Visual Studio 2015. I reinstalled it and it is working now.
Here is what I did:
Uninstall the Visual Studio 2015 using the installer (vs-community.exe) from https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
Install Visual Studio 2015 using the same installer(vs-community.exe) and choose Typical Installation
After the installation is done, run the installer (vs-community.exe) again and choose Custom Installation and choose to install Apache Cordova
Then I am able to open and build Cordova project
Not sure if this helps.
In my case with VS2015, the problem was about missing SDK build tools for Android. The lack of information is due to the fact that Visual Studio does not show all the build information by default. Once more information is shown, we could see issues with third party dependency issues like Android build tool. There are a couple of ways to get more information during a build.
MSBuild build output verbosity
Dependency checker on the Cordova tools
Both of these are available from the tools menu. For more information see this post:
http://www.ozkary.com/2016/01/visual-studio-2015-apache-cordova.html
hope it helps.
I have met this trouble in both VS2013Up4 and VS2015Pre. My OS is Win8.1 Pro x64. The detail message about the error:
Cannot find module 'q' MDAVSCLI 1 1 WinJSToDo.
And I can get nothing from double click it. Please help me. ORZ...
Currently I'm using Visual Studio 2013 update 4 with Visual Studio Tools for Apache Cordova extension on Windows 8.1. I create a new Cordova JavaScript Blank project and then trigger a build, it turns out to be below building error:
Error 2 Cannot find module 'q' C:\Users\penlv\documents\visual studio
2013\Projects\BlankCordovaApp1\BlankCordovaApp1\MDAVSCLI 1 1
BlankCordovaApp1
Seems many other users run into the same issue. Any help on this?
You can try this link if works.
And also this.
I tried but still have the same error.
Finally i have 'Cannot find module' error fixed:
copy 'lib' and 'resource' folder from 'C:\Program Files\nodejs\node_modules\vs-mda' to 'C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda'
in 'C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda' folder, run npm install command
I had this issue when my "User Account Control" was switched on (Windows 8.1).
The solution was to run Visual Studio as Administrator, and then clear your cordova cache, and rebuild.