I had an Android Studio project I created. The project was named App2-1. After I was done with that project I wanted to move onto my next project named App2-2 that is based off of App2-1. I copied and pasted the directory containing my project "App2-1" and named the new directory "App2-2". Then I opened up the directory using open project in Android Studio. No errors or anything. I made a whole bunch of changes and then I ran the app and it keeps opening my old app. Almost like it has a reference to it or something. Ideas?
Things I've tried:
Restarting Android Studio
Invalidating caches/Restart in AS
Restarted my emulator
Uninstalled my app from emulator/Clean install
Tried a physical device
I'm guessing my workflow of creating a new project based on an old project was incorrect. Appreciate any tips.
I would make a copy of the project in a new folder and in this copy delete the following;
.iml file
.gradle folder
.idea folder
build folder
then open Android Studio and select 'File > Import Project...' and select the new projects settings.gradle file and click 'open'
You might have to check the dependencies and re-build but hopefully this should set things up in AS from scratch.
For me, 'Gradle -> Tasks -> other -> clean' worked.
There might be a new functionality. For me worked:
File -> Invalidate Caches / Restart -> Invalidate and Restart
Tools > AVD manager > click the downward arrow next to your emulator > cold boot now
This should fix all of emulator problems.
For me using AVD Manager -> Actions -> Wipe data made it work.
Related
I moved an Android Studio project that used Gradle from D:\old\file\path to D:\new\file\path and now I'm getting the following error:
Installation failed with message Invalid File: D:\old\file\path\app\build\intermediates\split-apk\debug\slices\slice_8.apk
I tried uninstalling the app from my phone and still got the same error. I also tried an emulator but that didn't work either.
Close your project. Using your system file manager, delete all .iml files you have inside your project folder (probably this will be few files, two or three). This is the point where you instruct your A.S. to forget the older path.
Then import - not open - import your project on a brand new window of your Android Studio.
From the File menu, use Invalidate caches and restart. Clean Build and run again.
I figured it out.
Build -> Clean Build worked
Please Help, Android studio is not working and this error is comes.
I also reinstall the android studio but same error is comes.
I got the solution of the my problem.
Uninstall Android studio totally from the system.
Restart the system.
Go to C:\Users\
Delete .android, .AndroidStudio2.3, .gradle folders. If folder not deleted then change the name of this folder.
Now, Reinstall the android studio.
And then you problem will solved. This is work for me.
I got the solution there no need to Uninstall Android studio simply We need to do only one thing :
go to "file" and click on "Invalid caches\ Restart" option.
Don't uninstall your Android studio.
Rather try Like #Anjali has suggested.
go to "file" and click on "Invalid caches\ Restart" option.
If it doesn't work, close your Android studio and
Delete .android, .AndroidStudio2.3, .gradle folders. If any folder is not deleted then change the name of that folder.
And simply restart your Android studio. It has worked for me.
There is no need to uninstall Android Studio and maybe an issue occurs during the Gradle build time and Gradle cannot load data in the metadata folder or you have multiple data folder in the Gradle file.
Follow the below steps
Go to "C:\Users\PC\.gradle\caches\modules-2"
Close the Android Studio
Delete any metadata folder available from that listing or you can delete or rename the metadata folder as per your project given the error.
Start the android studio and ensuring that you have internet connections
Wait for Gradle to download some files and sync then
Everything should work well after doing that
I have followed the above steps and got success.
In my case this issue solved by just restarting my machine. My project was on 'D:' drive and this drive was getting corrupted and showing a message like 'unable to read files system'.
You can delete this file manually from Linux if you have it installed alongside windows
In my case this issue solved by just:
1- Open This PC, right-click the partition you want to scan, and choose Properties from the menu.
2- Navigate to Tools tab and click the Check button.
3- Check Automatically fix system errors and click Start.
When I started up my project this morning it randomly gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people had put up for this problem but they haven't been working. I invalidated my chaches/restarted my project but no luck. I also deleted my .gradle folder from my project folder and still no luck. If any of you guys could help me that would be awesome! This didn't happen yesterday when I was working on the project or anything, I wonder why its happening now. Oh yea it also says this as a gradle message: Error:C:\Users\Dave\.gradle\caches\2.2.1\scripts\settings_ad4t0wp5ikihzl1y1o83b5sbw\SettingsScript\buildscript\cache.properties (The system cannot find the file specified) :
Thanks again for anyone who reads this/ can help!
There is a file - "cache.properties" that gradle creates for you, upon first time inception of any project. The path for this file is "~Home_Directory\.gradle\2.2.1\taskArtifacts". You may find this path in your home directory. So basically, this file - "cache.properties" is missing from the "taskArtifacts" folder.
One of the solution that worked for me is to copy file - "cache.properties" from any test project of yours to this project that's currently experiencing an issue.
Regards
I had to choose using the Default Gradle Wrapper instead of local.
<< SETTINGS -->/ BUILD TOOLS --> Gradle --> radio button switch... >>
It has helped me to fix the same problem.
I had experience similar sync failed problem with gradle based android project (in Android Studio 1.1.0). I solved this problem without deleting .gradle from my user directory,
steps I followed was
Go to File -> Settings -> Compiler(Gradle Based Android Project)
Change VM options to -Xmx512m -XX:MaxPermSize=512m.
Click Apply -> OK and then tap on Try Again option in sync failed message to clean build the project.
Works like charm!!
UPDATE - 1 : For Android Studio 1.3, Compiler option mentioned in above Step-1 is present inside tab Build, Execution, Deployment.
I had faced similar kind of problem earlier!
But don`t know after rebuild the project and cleaning it, it worked normally.
Invalidate dependency cache by running
gradle clean build --refresh-dependencies
from project root and then re-import your project. Worked for me once.
May be you have put Android Studio into offline mode. To fix it, go to Preferences -> Gradle and ensure that the "Offline work" checkbox is not checked.
Than do
File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs
android studio 0.4.2: Gradle project sync failed error
Delete the folder C:\Users\.gradle and reopening the android studio solved my problem
I have been trying to understand how Android Studio IDE works by trying out a few things. I imported one of the sample projects –– Android DataLayer –– from Google repo, and it came with a few configured modules. Then I deleted the .idea folder and wanted to open the project again, but in the sidebar panel, all I see is emptiness.
What can I do to recreate the project?
Try syncing the project with "Tools" > "Android" > "Sync Project with Gradle Files".
If nothing changes when that process seems to be completed, then close and reopen the IDE.
If that still does not help:
Close the project via "File" > "Close Project"
Go into the project directory and delete the file .iml
(using your development machine's file manager e.g., Nautilus in Ubuntu, Finder in OS X).
Then, import the project using "Import Non-Android Studio Project" from the welcome dialog that appeared when you closed the project earlier.
Try creating a new project with exactly the same name, packageName etc. and then copy the folder from the new project into your old one
I'm using the most recent Android Studio and today my Mac crashed. After rebooting, I opened Android Studio and now all of my projects are erroring out with the Android URI not being found. They won't build, won't make, nothing. If I create a new Project, Android project is not one of my options, just all the rest of the options.
Is there anything I can do besides remove and reinstall?
I recommend you to Reset your Android Studio instead of fresh installation(At least give a try).
On Windows:
Go to your User Profile Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users\[your username] (ex. C:\Users\pyus13)
Inside this there will be a folder named .AndroidStudioPreview (It can be hidden so please check ).
Delete this folder (Better to take a backup before deletion).
This will reset your AS to defaults.
Now Start your Android Studio you will see the start dialog with settings.
Do the following to set your Android sdk path :
Go into Configure → Project Defaults → Project Structure → Project
Add new SDK and referencing to the SDK Folder that you have and then click apply and ok.
Try to open any of your earlier project or create new one and check. try syncing with Gradle after opening project.
For Linux
Depending on your AndroidStudio version, the settings are stored in ~/.AndroidStudio, ~/.AndroidStudio1.1 or ~/.AndroidStudio1.2.
Open a terminal and run the following code:
ls -a | grep Android # See which of those three folders above you have. Then rename each of the settings folders you have with the appropriate mv command:
mv .AndroidStudio .AndroidStudio.bak
mv .AndroidStudio1.1 .AndroidStudio1.1.bak
mv .AndroidStudio1.2 .AndroidStudio1.2.bak
Go to preference > Plugins uncheck the plugins which appear in red colour and recheck it again.
Do apply
Now the issue will get resolved
Resetting Android Studio worked for me!
You can reset studio by deleting .AndroidStudio directory from Users directory.
C:\Users\Abc\\.AndroidStudio
Thanks.
I'd recommend you do a uninstall of Android Studio and then do a clean install. It might be that there are corrupted or locked system files that are causing the issue. Make sure you backup your Android projects onto a USB first - just in case.
I have solved this problem for my latest android studio
Method I ( Unhide the AppData ) :-
1) Show your hidden files from view -> hidden items(check it)
you will see hidden folders & files as light color.
2) Then go to C:\Users\john (instead of john, it should be your user name).
3) Right click on "AppData"
4) Just uncheck the Hidden box
5) Move "sdk" folder from C:\Users\john\AppData\Local\Android to C:\Users\varad\AppData
6) Open android studio, goto Configure-> Project defaults ->Project structure
7) update new path of SDK like C:\Users\john\AppData\sdk
Restart Android Studio.
Method II ( Move your SDK to another location) :-
1) Move "sdk" folder from C:\Users\john\AppData\Local\Android to any folder you want.
2) Then update the SDK path in Android Studio from goto Configure-> Project defaults ->Project structure
3)Restart Android Studio.
:-) Enjoy Android Development.
I go this path:
C:\Users\...YOUR-USER-NAME...\.AndroidStudio3.2\config\disabled_plugins.txt
remove this line:
org.jetbrains.android
then refresh SDK in settings. Works fine now :)
This morning I downloaded android studio 2.1, and tried to create new project unfortunately I can't create new project, and I found this post #pyus13 suggests that to reset android studio, but it can't solve this problem.
And I checked android sdk in \AppData\Local\Android\sdk, saw android-23 in platform folder, with my previous experience with eclipse it is ready for running. A couple of hour I found a way to solve this problem, I download android 6.0, api 23 (SDK platform) with android SDK Manager. Do again for creating new project, it is ok.
Thank
For MAC User
All plugins, SDK setting was correct still faced the problem.
Applied following solution - on MAC
Give read write permission to .android folder
sudo chmod -R 777 .android