I have a javascript file (ParameterFunctions.js) which isn't making it to the device for some reason.
It's definitely in the project:
I extracted the apk and it's definitely inside of it:
When I look at the files on the device is doesn't exist:
Why is this happening and how do I fix it? I've tried:
Invalidate caches and restart
Uninstall and reinstalled
Sync project with file system
Sync project with gradle files
Reboot the device (both before and after reinstalling)
I figured it out. There was a syntax error in the js file I was trying to include. Rather than report it Android decided that the entire file shouldn't be recognized.
Related
The power went down and on restart all files are showing these weird characters and message is saying about I am using wrong encoding.
The interesting thing is, the code is appearing like this only in Android Studio. If I open any of individual file with notepad, the code is just fine.
Actually, I got into the same problem To fix this issue
First, try Invalidate caches and restart if it not works then delete .gradle .idea folders in the project directory and open the project again.
Note: Take Backup of project folder before trying
I updated my android studio into 2.3 then upon connecting my app to Firebase, it gave me an error:
Error:Unexpected lock protocol found in lock file. Expected 3, found 0.
Do I need to go back to 2.2.3 or is there any way to fix this? I tried deleting .gradle file in my project but it still gave me an error.
Delete the .gradle folder from user directory, not from the project.
C:\users\username\.gradle in windows
/home/username/.gradle in Linux
/users/username/.gradle in Mac
Before you go deleting your entire general .gradle folder for android studio, please note the following implications and consequences.
It will cost as much as 3 -4 GB to re-download its content
The download could take days if you are not careful and the network is not super fast
For every old project you reopen, chances are some items are missing, therefore, the android studio will have to redownload missing content, god help you if you chose to take out your laptop at a random eatery without free internet and quickly get some work done.
The deletion process involves thousands of file, up to 119k, the operating system finding them will take forever and deletion will take even longer.
Here is a much better solution;
Close android studio completely
Using the file explorer of the operating system, in your app's project folder open the .gradle folder
Note the number(name) of the folder in it, such as (2.3 or 4.4 or 4.6 or 4.8)
Go to your general .gradle folder as described by #Gabriele Mariotti
open it and open the "caches" folder
Delete the folder with the same number as the second step
If you are paranoid like me you could also delete your project's .gradle file too (not necessary)
The file is not larger than 4 MB and it will not be re-downloaded but regenerated by android studio automatically, therefore the whole process should not take you 5 mins, costs no data, and all previous projects function as normal.
For linux users, Press ctrl+H to show hidden files inside home directory because .gradle directory is usually hidden and delete .gradle directory.
After that you might receive an error as "cannot lock build output"
then remove the lock files in the gradle cache by executing something like this:
find ~/.gradle -type f -name "*.lock" -delete
Delete the .gradle folder from the project's root folder.
For example if your project root folder is MyApp.
Close your project in Android studio
Remove your project from project list.
Exit from android studio.
Go to the MyApp Folder.
Find the .gradle folder.
Delete it.
Restart Android Studio.
Import your Project again.
Android Studio will download again all necessary Gradle files automatically (Internet Required).
All Done.
Ok, so recently I've been trying to run my application on Android Studio (1.1.0), but every time I try to run it, the following error pops up:
Waiting for device
Target device: samsung-blah-blahblah
Uploading file local path: C:\Users\jimmykim9001\AndroidStudioProjects\blahblah\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/blah.com.blah
Local path doesn't exist.
Now by doing some research I've come to this link: https://www.youtube.com/watch?v=i4WcMIyc8OQ This would have been helpful if I was able to find my apk files when searching my project; however, they're not there, which is strange because I'm pretty sure they're supposed to be created automatically. So I tried to rebuild the project, but that fails half-way through (Failed to complete Gradle execution. Cause: ). What I need to do is get Android Studio to generate the app-debug.apk file, but I have no idea how. All the links I've found involve moving the file into the right place, but the file itself doesn't exist for me. Any ideas?
Note: I imported a jar file recently and ever since I did that, the problems started. Not sure if this matters or not.
I got your question. I have also faced the same problem some time ago. Let me clue you in , here is some approach i would like to try :-
Your apk must be here ( if it have been automatically generated)
your_app_name\app\build\outputs\apk
If app-debug.apk is not there then , Clear the cache File -> Invalidate Cache, then restart your IDE . Then rebuild it.
Try removing the jar you have recently added and rebuild the project.
you can try re-importing your project.
From above all what worked for me 1st point . Try these .................................best of luck.
Here are some links you might like to see....
Build unsigned APK file with Android Studio
Apk location in New Android Studio
I've installed a fresh version of Android Studio and from there created a new application. It created my file but the Gradle causes me a lot of problem. For the whole day straight it always try to download the gradle-1.10-all.zip but as always it fails.
Message is:
Gradle:Download http://services.gradle/org/distributions/gradle-1.10-all.zip
Hope they decide to add up some progress bar for this. LOL
I'm in doubt that this is due to internet connection just to take note. Although I'm investigating about the possible solution via HTTP proxy.
Now for an alternate solution I tried to download the whole zip file instead from http://www.gradle.org/downloads. While I successfully downloaded and extracted the whole zip file. Then from android Studio I tried setting the Global Gradle Settings into offline work and as well as the Project-level settings into: use local gradle distribution and mapped the extracted zip file (although I'm not sure if this is the correct way to do this)
Does anyone know on how should I do the workarounds for this?
Hope that maybe someone can help me work with this or someone who already solved this issue since for now I don't have a plan to update from this version anymore given that each and everytime that the Android Studio updates it was always been a pain in the ass and Second I need to work on most of my projects offline.
Found out the solution on this. First you need to download the whole zip file from: http://www.gradle.org/downloads
Next step is to just let the Android Studio Create the folder for the .gradle in your User then from there you can just halt the project initialization and then go to the location of the .gradle folder. In my case it's:
C:\Users\USER\.gradle\wrapper\dists\gradle-1.10-all\SOME_SORT_OF_STRING
Just copy and paste the whole zip file on the location (no need to unzip the file). Also you have to make sure it has the same version with the one in your gradle wrapper folder which in my case is gradle-1.10-all.
Try restarting the Android Studio. You can create a new project once again and let it extract the zip file. It should now start on downloading the other files needed and from here you will need a reliable and stable internet connection. The succeeding files will have a smaller size compared to the zip package but in my case since I don't have a stable connection I used to tether my mobile phone instead and viola! Android Studio installation is now complete and running.
There exist options for offline working.
On command line add --offline option to your gradle command.
In Android studio you can set this option in the setting on the gradle configuration part. Just check the checkbox
Another way of doing is to find a friend that is already started using the studio, You can copy .gradle ,. androidstudio/.androidstudiobeta and .android directories in your user directory. If gradel is your only problem just copy that one only.
I get the following error sometimes during compling and running the application using eclipse.
Failed to install ABC.apk on device '4df11bd574734fd9': Local path
doesn't exist. [2013-08-20 09:28:04 - ABC]
com.android.ddmlib.SyncException: Local path doesn't exist.
[2013-08-20 09:28:04 - ABC] Launch canceled!
The pop up in eclipse says that, the application contains some errors, which I need to fix.
I have updated my eclipse and other related things to latest.
I followed all the posts whihc talks about resolving this error, but none of them work for me. I see that once I get this error, my bin folder is kind of locked and I cannot delete it. Currently, the only option left for me is to restart my laptop and then it starts to work again but it is very tedious and time taking.
Can someone suggest me what should I do?
Well finally I make it. there was a program/process that has blockep miapp.apk file, so when I tryed to clean my App it doesn't drop this file. I stop the program/process and delete manually apk file. now its running great.
okay i found the solution
just transfer all your project directories except bin directory into another folder location of same name as your project name.Now import your project from new location.your project will run this time
Also suffered from this issue. The culprit turned out to be Google Drive, which for some reason locked the .apk file after I shared it to my Drive and then caused all kinds of headaches.
Closing the Google Drive tab fixed the issue.