Android Studio - Error: Local path doesn't exists - No apk generated - android

I recently downloaded latest version of Android Studio today. I configured and setup everything properly but when i create a new project and try to run and debug in the connected phone, it will show this error.
Error: Local path doesn't exists.
Also, i search for apk file but no apk was generated anywhere.
I am using Android Studio 1.0 built on December 5 2014.
SDK manager is also no starting from Android studio.
Please help.

I got the same problem since update to 1.0 version, the bug comes from an internal script which is supposed to finds the distribution of Java but isn't working correctly on 32-bit Windows systems (SDK Manager was also impossible to run) and it has been fixed in the 24.0.1 release of the SDK.
Solution :
In line 27 of tools/lib/find_java.bat has a problem:
find /i "x86" > NUL && set arch_ext=32 || set arch_ext=64
You must remove space after "arch_ext=32". Correct code is:
find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
You should be able to open SDK Manager by now, and update Android SDK Tools.

Read this possible duplicate
Android Studio - local path doesn't exist
As for the APK, it does not get generated unless you do it.
It is meant for release your project into android file format when you are ready to distribute it.
I took a screenshot for you to see:

If you are using studio on Windows and your windows username contains special symbols like '&' - RENAME YOUR USERNAME (and user folder)!

My Issue has been resolved by following answer here https://www.reddit.com/r/androiddev/comments/2pfm2e/android_studio_local_path_doesnt_exist/ .
Please find the main points as follows.
Assuming you are on a mac/linux machine. If on Windows, use "gradlew.bat" instead of "./gradlew":
1) Close Android Studio
2) Open command line to the root of your project (the location of gradlew)
3) Run "./gradlew clean" to clean your project
4) Run "./gradlew --stop" to kill off any remnant Android Studio gradle daemons which may be caching stuff
5) Run "./gradlew assembleDebug" to build your project anew. (I am assuming you are building a basic debug configuration. If not, feel free to run "assemble" with your custom configuration.) If there are any issues with the project, you will see them here.
6) Restart Android Studio and try building again.

Related

how can I compile android project to apk

at the first experience with android, I don't install android studio!
Just cloned a project and search according to see gradlew.bat file. but when I run it:
PS D:\projects\android> .\gradlew.bat assembleDebug g
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\projects\android\settings.gradle'
* What went wrong:
Could not compile settings file 'D:\projects\android\settings.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
...
my settings.gradle:
include ':vlc-android-sdk-3.0.0'
include ':app'
rootProject.name = "DSM"
is SDK needed? what's emulator has used in this link: https://developer.android.com/studio/build/building-cmdline
how can I build apk finally?
Yes, you need the Android SDK to build, run and debug apps! if you don't want to install Android Studio, you can download the basic Android command-line tools from this link: https://developer.android.com/studio#downloads. You can use the included SDK manager to download other SDK packages.
The above-mentioned error is also thrown when an incorrect JDK version is installed in your system. [Also] make sure you also set up environment variables like ANDROID_HOME, JAVA_HOME, and platform-tools with their respective locations on your pc. most of this setup is taken care of by default on installing Android Studio!
I never use this method to compile my android project into an .apk
I use an alternative method which I find easier than compiling .apk in the android project.
What I do is -
Build the Android Project by clicking on the build icon.
After the build is successful, Open File Explorer of on your PC.
Then going to the file location - D:\User\Android Studio 4.0.1\Applications\SampleApp\app\build\outputs\apk\debug
Now drag the .apk file to upload it anywhere!
For testing it in mobile without connecting USB, you can Gmail yourself by uploading the file through Google Drive. And then downloading the .apk through Gmail in the Mobile Device.
NOTE : the file location I have mentioned in Point 3 is different than yours, because I always keep my projects in D: drive. It would be similar after you go to your application folder (after SampleApp folder).

Issue with WIndows MDHA with visual studio 2013

I'm trying to learn something about multy hybrid app developing under visual studio 2013 using Apache Cordova. I've just created a new project and i'm trying to build it but when I try to build it for android I get 1 warning and 1 error.
warning:
Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 95 5 helloWorld
error:
Error 2 The command ""C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "helloWorld" --language "en-US" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 1. C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 99 5 helloWorld
I've googled those errors but I haven't sorted anything out. Do you know what is the problem?
The issue is because of Android target (latest version) is not available with Android SDK. Make sure the following in your system,
Go to Android installed folder (for me, C:\Users\username\AppData\Local\Android\android-sdk)
Go to tools folder and select "android.bat" Run as Administrator
Check whether the latest version of Android (ex: API 19) is installed or not
If it is not installed, select that API, click install by accepting License
If it is installed, close it and then Go to to root folder(ex: C:\Users\username\AppData\Local\Android\android-sdk)
Double click on the AVD Manager and create new AVD
Now I hope, you can able to build and run the application.

Android Studio Error: "You must install the Android Support Repository though the SDK Manager"

I just initialised a project on Android Studio, and it was working fine in version 0.2.6, but in 0.2.7, I get this error:
It creates a folder inside my Applications directory, but it does not initialize the project. Any help regarding this problem would be appreciated. I get no problems with version 0.1.1 through version 0.2.6, but when it comes to 0.2.7, things start to get problematic, like this and I can't even start a project.
With 2.7 update I got the same issue. It looks like now Android Studio thinks sdk lays in under its own folder at android-studio/sdk.
You should be able to use android app under android-studio/sdk/tools to get missing components (not tested).
Another solution would be to fix sdk path (tested):
Close any projects then drop to Welcome to Android Studio Dialog
Select Configure -> Project Defaults -> Project Structure
Select SDKs -> Android SDK -> Android SDK Home Path
Update it to your previous sdk location.
got the same problem when applying the last patch (2.7). I've resolved it by copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\ then I've launched it and install the missing component.
After restarting Android Studio it works again !
You must manually run SDK Manager.
Folder: android-studio/sdk/tools
Search for android or android-sdk
The new Support Repository must be already selected, and you need only click the "Install" button.
Just as Leonidos said, install ASR through SDK Manager:
Tools > Android > SDK Manager ; Navigate to the Extras folder, and select Android Support Repositories.
Click install packages and it will work fine
I did a fresh install of Java, SDK and Android Studio, update it to 0.2.7 and install the ASR through SDK Manager, but the messages comes again.
So i found this solution.
The most common problem for Android Studio and 64Bit Windows System is the no 8.3 short path for
C:\Program Files and C:\Program Files (x86).
find_java.exe
couldn't handle it and give a wrong path back.
Finally do this:
dir /x C:
-- It shows no 8.3 short paths.
fsutil 8dot3name query C:
-- It shows NtfsDisable8dot3NameCreation is 1 on "C:",
means 8.3 short path won't be created in "C:".
Then I enable the generation of 8.3 short name by:
fsutil 8dot3name set C: 0
and create short names for C:\Program Files and C:\Program Files (x86) in windows recovery mode by:
fsutil file setshortname "C:\Program Files" PROGRA~1
fsutil file setshortname "C:\Program Files (x86)" PROGRA~2
And now dir /x C: can show the short names.
And now find_java.exe -s
can show the short path C:\PROGRA~1\Java\JDK17~1.0_2\bin\java.exe.
And now find_java.bat and android.bat can work good now!
source
Also copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\
Just a few ideas to try that should hopefully help. These can be found by using Ctrl + Shift + A.
"Sync project with Gradle" - (it's also often in the toolbar with a green and yellow ball and a blue down arrow next to three android icons)
"Gradle" and select the ToolBox option; then hit the blue refresh icon to refresh all the gradle projects
"Project Structure..." (also available under File) Under the Libraries project settings you should see a valid reference to your support library. You'll also want to skim through everything to make sure everything else looks good with the project.
"Invalidate Caches..." (another available under File) Invalidate and restart. This one got me going again after the previous upgrade generated a bunch of errors.
Some of these may be redundant, but after having fought with similar issues in the past it's just a few easy things I've found to check.
If refreshing everything doesn't work you can always pull up the Android SDK from Tools -> Android -> SDK or from the toolbar with the blue/green boxy android that has a black down arrow. It should be next to the Sync Gradle button.
I update the Android Studio(AS) and see the same issue.
However, there is something slightly different about what I find out.
I actually have two sdks because I shift from Eclipse to AS.
Hence, I get one sdk in
c:\Program Files(x86)\Android\android-sdk
and anther in
c:\Android\android-studio\sdk.
And the real one that I use is in c:\Program Files(x86)\Android\android-sdk.
The important thing is that, I find that only one of the sdk setting is changed after the update.
Quick Start > Configure > Project Defaults > Project Structure
> Platform Settings > SDKs
1.7
JDK home path:
C:\Program Files\Java\jdk1.7.0_10
Android 2.2 Platform
Android SDK home path:
C:\Program Files(x86)\Android\android-sdk
Android 4.0.3 Platform
same as 2.2
Android 4.2.2 Platform
Android SDK home path:
C:\Android\android-studio\sdk <- it is modified after update!!!!
Android 4.3 Platform
same as 2.2
After fixing the path in 4.2.2, I could create new project successfully again.
For some reason, if you install Android Studio in the same directory as the SDK, this error will pop up. Just install it somewhere else.
For instance, I had it installed at C:\Android\, along with the SDK. Then, I decided to install it at C:\Program Files (x86)\Android Studio and it simply worked.

Error in android studio while creating new project [duplicate]

When I try to build a project on Android Studio, I get this error:
Compilation completed with 1 error and 0 warnings in 9 sec
1 error
0 warnings
org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
What can I do to fix it?
UPDATE:
When I look at the Error Log, I saw this:
org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings:
org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings
Please read the log from:
On Microsoft Windows:
[Windwos Drive]\Documents and Settings\[your username]\.AndroidStudioPreview\system\log
On Mac and Linux: ~/.AndroidStudioPreview/system/log/
And you will find the tmp download path of gradle-1.6-bin.zip. For example, mine is:
2013-05-17 09:42:16,934 [ 283002] INFO - ution.rmi.RemoteProcessSupport - Unzipping C:\Documents and Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\gradle-1.6-bin.zip to C:\Documents and Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok
...
Caused by: com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
java.util.zip.ZipException: error in opening zip file
So I know the cause: I downloaded an incomplete ZIP package.
Then I downloaded the full ZIP package from http://services.gradle.org/distributions/gradle-1.6-bin.zip manually and copied this ZIP package to:
Windows: C:\Documents and
Settings\Kiki.J.Hu\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\
Mac OS X: ~/.gradle/wrapper/dists/gradle-1.10-all/6vpvhqu0efs1fqmqr2decq1v12/
Everything is OK now.
For OS X:
Install Homebrew as a package manager. Then on Terminal, run:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install Gradle:
brew install gradle
It is the easiest way to get Gradle.
Before you click to new project, go to configure and set your proxy. I recommend set host name and port number, since I had problems with auto-detect proxy settings. Check your connection in settings.
I also had issues downloading Gradle through Android Studio.
This was my workaround:
Download Gradle directly from http://services.gradle.org/distributions/gradle-1.6-bin.zip
Copy the contents of gradle-1.6 to \Android\android-studio\plugins\gradle
Copy gradle.jar to \Android\android-studio\lib\
Restart Android Studio
Hope this helps!
Edit the gradle wrapper settings in gradle/wrapper/gradle-wrapper.properties and change gradle-1.6-bin.zip to gradle-1.8-bin.zip.
./gradle/wrapper/gradle-wrapper.properties :
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
It should compile without any error now.
In my case this was because the system had low memory. When I closed some applications, the error disappeared.
For me it turned out to be my firewall, which is VIPRE, was blocking the Gradle.org site and quietly causing a bad gradle-1.7-bin.zip to be created under .gradle\wrapper\dists\.
I had to open VIPRE and add gradle.org to "Bad Web Site Exceptions" (menu File -> Settings -> Firewall).
Then I downloaded http://services.gradle.org/distributions/gradle-1.7-bin.zip using a browser and overwrote the bad version. I restarted Android Studio, and all is good.
FYI, on my Mac, it was downloading Gradle into the ~/.gradle directory. You can see how it's progressing by looking there:
du ~/.gradle
I noticed that my MyProject/gradle/wrapper/gradle-wrapper.properties file was completely empty, so I deleted it and Android Studio proceeded to download whatever it needed.
After that it worked.
I tried Kiki Hu's solution, and it worked. After that, there will be more downloads from the Maven repository which includes Dalvik Debug Monitor Server (DDMS), Guava, etc., which again is not required if you are exporting from Eclipse into Android Studio.
If you're like me, you tried to start a version prior to 0.2.0. Following Google's notes
in Getting Started with Android Studio, you'll need to remove and re-install Android Studio.
"Note: There is not a patch update available from 0.1.9 to 0.2. To update from Android Studio 0.1.x to 0.2.x, you must install a new Android Studio bundle from this page. The reason for that is that we have made changes to the bundled SDK such that it includes a pre-configured local Maven repository which can serve up the v4 support library and which is required for creating new projects."
Also be aware that if you have your Android SDK files stored in C:\Program Files (x86)\Android\android-studio\sdk you should move them before the uninstall, or you'll need to download the SDK files again.
After the un-install and re-install, it is now working on my Windows 7 64-bit system.
Remove all files from C:\Documents and Settings\[User]\.gradle\wrapper\dists\, rebuild the project and rebuild your project on Android Studio. It works for me :)
I have noticed one thing: When my Android Studio is build 130.737825, it automatic downloads Gradle 1.6 to C:\Users\yourname\.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/.
However, when I update my Android Studio to build 132.821530, it automatically downloads Gradle 1.7 to C:\Users\Administrator\.gradle\wrapper\dists\gradle-1.7-bin\2g3i7gan25uopmtc0lnjb1l9ff.
I don't know if it matters.
I had this error under fresh installation of IntelliJ (14.0), the problem was that I had not specified JDK. Fix: press ctrl + A + S (project structure), and check if SDK is correct.
my error looked like this:
Error:Android Gradle Build Target: org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation ...

ERROR: dump failed because no AndroidManifest.xml found

When I try to upload an application to Android Play store I get the following error:
ERROR: dump failed because no AndroidManifest.xml found
Steps that I took:
new HDD, install clean jre, jdk
download Android eclipse bundle - latest version today
make a new project, sample. simple hello world
sign it with the wizard, create a certificate etc.
try to upload it on the market...=ERROR!
I tried many combinations, different eclipse versions. Even to sign it manually. It doesn't work.
If I try to run aapt dump badging I get the same error.
Just write in the terminal
flutter clean
Just delete app.apk file from: /build/app/outputs/apk/app.apk.
Visual Studio will create a new correct app.apk file.
I dont know o 'why' of this.
I faced this problem using Visual Studio Code in a Flutter project and Im posting my solution because it can help others.
I just run 'Flutter Clean Project' and then I run the project.
All works again!
In my case the problem was with the filename: I accidentally (subconsciously) renamed it to .apk, when it should be .aab 🤦
following points are need to be taken care of while uploading file on
android market
"android:versionCode" attribute from AndroidManifest.xml is proper.
"android:versionName" attribute from AndroidManifest.xml is proper.
The package name is very unique,. Because all the apps on android market are separated by the package.
see all this is in place....
taken from while uploading file to android market error
I had this issue suddenly as well,
my solution was
flutter clean
flutter build apk
and it started working again
OPTION #1: Slow down an re-read every step. (Source).
Basic Setup for Signing.
Before you begin, make sure that the Keytool utility and Jarsigner
utility are available to the SDK build tools. Both of these tools are
available in the JDK. In most cases, you can tell the SDK build tools
how to find these utilities by setting your JAVA_HOME environment
variable so it references a suitable JDK. Alternatively, you can add
the JDK version of Keytool and Jarsigner to your PATH variable.
...
Eclipse Users
If you are developing in Eclipse/ADT (and have set up Keytool and
Jarsigner as described above in Basic Setup for Signing), signing in
debug mode is enabled by default. When you run or debug your
application, ADT signs the .apk file with the debug certificate, runs
zipalign on the package, then installs it on the selected emulator or
connected device. No specific action on your part is needed, provided
ADT has access to Keytool.
OPTION #2: Test the features required by your application with an unsigned '.apk'. (Source).
You can use the aapt tool, included in the Android SDK, to determine
how Google Play will filter your application, based on its declared
features and permissions. To do so, run aapt with the dump badging
command. This causes aapt to parse your application's manifest and
apply the same rules as used by Google Play to determine the features
that your application requires.
To use the tool, follow these steps:
First, build and export your application as an unsigned .apk. If you
are developing in Eclipse with ADT, right-click the project and select
Android Tools > Export Unsigned Application Package. Select a
destination filename and path and click OK. Next, locate the aapt
tool, if it is not already in your PATH. If you are using SDK Tools r8
or higher, you can find aapt in the /platform-tools/ directory.
Note: You must use the version of aapt that is provided for the latest
Platform-Tools component available. If you do not have the latest
Platform-Tools component, download it using the Android SDK Manager.
Run aapt using this syntax:
$ aapt dump badging <path_to_exported_.apk>
compile it & export the project under Linux (eclipse)
switch to InteliJ Studio (recommended)
It seems that from time to time there is a problem with eclipse under Windows 7,8.
flutter clean && flutter run
also works
I'm using VScode.
What happened:
After dart update, there was a permission error on flutter.bat
Solution:
Locate flutter.bat and give Full controll.
Open a cmd with Admin privileges, locate the folder that you are doing the development.
use 'FLutter clean' command (do not use vscode Terminal)
rerun app using 'Run without debug'
run flutter clean then flutter pub get. Then run your application, it should work
Error while run xamarin.uitest on using android sdk build tools 29.
Problem solved by changing android sdk build tools to 28.
I have same problem and solved by deleting all folders containing apk files in the location -
D:\FLUTTER\MY PROJECTS\SAMPLE\myapp\build\app\outputs.
if any folder is found access denied then force delete the folder or restart your system and try deleting the folder, then rebuild the app. It will work.
Go to the directory build/app/outputs/apk/debug , and the directory build/app/outputs/apk/flutter-apk . Erase the present files, once the compilation has run these files will rebuild and the error will disappear!

Categories

Resources