Some conflicts were found in the installation area, while updating android studio 2022.1.1 patch 1 - android-studio

I am getting this error while updating Android Studio 2022.1.1 patch 1 some patch gets downloaded and following error comes,
Some of the conflicts below do not have a solution, so the patch cannot be applied.
the files that is shown are:
jre/
jre/bin/
jre/bin/.marker

I get the same error.
Also to mention, because I don't know if that does matter, when I updated to electric eel, i hat to make a link by mklink /j jre jbr because it seems like they changed the folder name from jbr to jre. Many other solutions on stack overflow recommended to just create a jre folder and copy all the jbr stuff in it.
I was thinking that it is a temporary mistake and they will rename it with future updates back to jbr. That's why I kept the jbr folder and just linked to it with the jre link.
EDIT:
Just like the text said, I downloaded the new version from web and reinstalled Android Studio. Now it created by it self a jre folder that contained a bin folder that contained a .marker file.
The new installation by it self didn't work. Flutter doctor showed my some issues like that the android licences are not accepted and that it can't find java.
I manually copied the contend from the jbr to the jre folder, but also made sure that the .marker file stayed in the jre/bin folder.
Now everything seems to work again.

Related

Android Studio: This file not part of the project, but the project builds successfully

I have a strange problem that suddenly appeared in android studio. I created a new cpp file, and included it in Android.mk. Then I synced the project. However, android studio still complains that the file is not part of the project and that I need to sync, BUT the whole project builds successfully.
Likewise, if I remove one of the other older files from Android.mk that it did not complain about, and resyncs and then tries to build the project, as expected the build fails, but android studio does NOT complain that that file is not part of the project anymore.
So somehow, suddenly the android studio editor is not able to correctly identify which files have been synced and are part of the project, but during compilation everything works as expected.
Does anyone know how to fix this annoying problem? I have tried clean project, invalidate caches/restart as well as updating android studio without luck (AS version 3.4).
I used Build > Refresh Linked C++ Projects menu and it worked.
I had a similar problem. Like yourself, I have tried everything.
Invalidate and Restart: Doesn't work
Manual deleting folders: .gradle .idea .ndkbuild etc. doesn't work
Clean, Rebuild, Link C++ Files: Doesn't work
One thing that kind of helped me was: I changed the NDK version. I compiled, then got a compilation error (didn't matter because it was the wrong version of NDK anyway), then I reverted to the original NDK. This appeared to solve the problem, however, it got back again.
My solution was to reset Android Studio to factory settings. If you are on Linux, you can start by deleting these folders:
rm -rf ~/.android
rm -rf ~/.AndroidStudio3.4
Then you download and run your Android Studio and not import anything from anywhere.
I suspect the problem was caused by one of the plugins I've installed.
It may be a good idea to backup those two folders from time to time and reload them from there if necessary.
EDIT: It seems that my problem persisted after the above solution after adding more .cpp files. After seeing that, I searched where that popup came from. It follows that "This file is not part of project..." popup is pushed from ndk-build. (Class name: NewCppSourceNotificationProvider - StaleCppProjectNotificationPanel). What I tried, and what worked so far; I used Android Studio 3.5 Canary13 with NDK version r19c (Stable version). I hope this helps you.
Problem Environment
Android Studio 3.5 RC 2
gradle-4.10-all
com.android.tools.build:gradle:3.2.1
Solution
Update to:
- gradle-5.5.1-all
- com.android.tools.build:gradle:3.4.2
Steps
From the project root run (note this has to be done first):
./gradlew wrapper --gradle-version 5.5.1 --distribution-type all
In root build.gradle file:
buildscript {
//...
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
//...
}
}
I have similar problem, it could be the compatibility issue of gradle version and gradle plugin version, because my solution is replacing the old configuration
// build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
...
// gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
with the following new one by changing gradle version from 4.6 to 4.10.1.
// build.gradle
classpath 'com.android.tools.build:gradle:3.2.1'
...
// gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
After that, Android studio can index and track my new cpp files in project.
fix this by update my 'com.android.tools.build:gradle'
Had the same problem with Android Studio 4.0.1 and the latest gradle at this time (6.1.1?). The problem went away after I exited Android Studio and deleted .gradle and .idea folders in the project main directory, plus deleted .cxx and build directories in the affected module directory. I'm not sure which really helped, but most probably deleting .grade and/or .idea
I fixed with update 'com.android.tools.build:gradle' in the artic fox version 2020.3.1
For those struggling with this for me I made a small change to CMakeLists.txt (I altered the version required). This forced the CMake to regenerate, and all missing files were added. This is quicker than the other options listed here.
This applied to NDK 21, so YMMV!
Invalidate cache and restart and you should be good. However, make sure you checked the Clear file system cache and local history checkbox.

Android studio fails to find cmake

Due to disk space limits I moved my android SDK to a new drive/location.
I can no longer clean the project as android studio fails to locate cmake because it's looking in the old directory.
I updated the sdk path and most things work, I can even build the project and external ndk files.
But build->clean Project in android studio 3.3.2 can't find cmake when trying to clean because it's looking in the old sdk directory for cmake.
I've completely reinstalled the sdk and android studio from scratch, but it still looks in the old directory on the wrong drive when trying to execute:
task ':app:externalNativeBuildCleanDebug'
Where is this compiler location setting or script or path? and how do I change it to look in the right directory?
I used a grep tool to look for the old directory. They were mostly contained in the .externalNativeBuild directory -- I tried deleting the directory and letting android studio rebuild it, and that managed to clear whatever temp files were holding onto the old sdk directory. It seems to work now.

Android Studio “cannot resolve symbol R” but project compiles and runs

Android Studio displays in all java files in red : “cannot resolve symbol R” but the project compiles and runs.
I have tried every solution here:
Android Studio "cannot resolve symbol" but project compiles and works, but with no luck.
I tried to :
invalidate caches and restart android studio
delete .gradle and .idea folders
clean and rebuild the project
install a new version of android studio
mess up with gradle file then undo changes and sync project
One thing that I want to try, but I don't know how to achieve, is to reopen the project from scratch as I was opening it for the first time, but I don't know how to do this.
I also tried answers from here:
Android Studio says "cannot resolve symbol" but project compiles,
but again with no luck.
Android studio version = 3.2.1
dependency versions in gradle project file:
classpath 'com.android.tools.build:gradle:3.4.0-alpha01'
classpath 'com.google.gms:google-services:4.0.0'
For some reason that i do not understand ,
this combination of build versions made the issue :
grade version = 4.10.1
classpath 'com.android.tools.build:gradle:3.4.0-alpha01'
when i switched to these build versions :
grade version = 4.6
classpath 'com.android.tools.build:gradle:3.2.1'
The issue was solved !
File -> Close project
Open an existing Android Studio Project
Open you project
Hope it will work.
sometimes, R file is not generated because of package name on android manifest is not match with package module that you have.
Is any wrong syntax or spelling in your xml?
Check your layout or any xml file.
Android Studio seems to have a caching issue with R.java occasionally. I rarely have a problem with this, but when I do, I actually open R.java (double press shift and type "R.java") or navigate to R.java under "app/build/generated/source" directory, opening the file and checking if the relevant XML id has been created. If it has, it forces Android Studio to now recognise the id's that are not being resolved. It's quick to try, and doesn't require clean and rebuild.
From your programs menu, open android studio. instead of opening your project from the recent files, select to open a project from your computer and then locate the path to your project. When all else fails, sometimes this works.
Also, try commenting out the support libraries from your gradle implementation, sync your project, and after sync fails comment them back in and sync again. (not sure if that's what you tried already when you said you messed with the gradle file)
In my case,
I am using
- Android Studio version 3.3.1 at home
- Android Studio version 3.2.1 at office
When i pulled projects to my office computer that are firstly created at my home computer ,
Android Studio can not resolved R file but runs application with no error. Because projects gradle and Android Studio version are incompatible.
Only thing that you sholud do, change the gradle version in project level gradle file
classpath 'com.android.tools.build:gradle:3.3.1'
to
classpath 'com.android.tools.build:gradle:3.2.1'
I was facing same issue,
first thought the issue might because of some xml file or naming of drawable resources incorrectly. After analysing, this case wasn't applicable to me.
So
Updating Android studio from older version 3.2 to newer version 3.3.2 along with new build tool version from SDK manager resolved this issue
for me.
I've tried invalidate cache and Restart AS with clean rebuild all the options but didn't work for me.
It says cannot resolve symbol, but it can run.
In my case, I just reload the needed *.jar files to the libs folder.
File >> invalidate caches/restart
Rebuild Project
Sync
Run
Works for me!
It looks like the library did not load my "imports" properly the first time.
That's why the import methods cannot be seen in my main_activity.xml.
This happened to me when I was going back and forth between different SDK versions.
Apparently SDK manager copied all the source files but it didn't finish cleanly. As a result I could compile and run my project just fine but IDE didn't recognize the SDK and reported all java symbols unresolved.
None of the above and other solutions in SO didn't work for me, but just uninstalling/reinstalling the specific SDK version did a job.
If you renamed your package (inside java folder), make sure you change your Manifest package name to the same
The only thing that worked for me was,
replacing,
import package_name.R
with
import package_name.*
simply go to project settings : settings.gradel and change the rootProject.name to your current name
rootProject.name = "write the project name here"

How to install Android SDK on Linux after deleting earlier version? (2017 Martch)

In the past I could download and install Android SDK separately. I cannot find it any more on Google's Developer site, only Android Studio, which supposedly contains the SDK too (?). When starting the Android Studio it looks for the SDK.
I installed the Ubuntu (I'm using 16.10 Yakkety Yak) repo's Android SDK, that didn't help much because it is in /usr/lib/android-sdk with root privileges and Android Studio disses it. Now I'm scratching my head how I going to scrape all of that off as soon as I find out where can I install an SDK from.
I did check at least 2-3 Stack Overflow Questions on the topic, but all of them seems to be outdated, so please be very careful to mark this as a duplicate.
I have to add that I had both the SDK and the Studio installed before on my system. That turns out to be crucial info.
Are the "command-line tools" at https://developer.android.com/studio/index.html#downloads what you're looking for?
Go to https://developer.android.com/studio/index.html#linux-bundle and download the zip file. Extract it into your home directory(or anywhere inside your home directory).
Move into that extracted files directory, open up bin folder. You'll see a file[script] named studio.sh. Run that and Android will automatically start downloading the SDK.
Alternatively:
Set your ANDROID_HOME environment variable to /usr/lib/android-sdk:
vim /home/user/.profile
Add
export ANDROID_HOME="/usr/lib/android-sdk"
Well, after wiping the .Android-Studio-2.x and .android directories form my home, Android Studio offered the installation of the SDK. So the cause was leftover of previous installs, I haven't mentioned that fully in my question.

Android Studio Update: Some conflicts found in installation area

When I start Android Studio, it shows popup regarding new update of 1.1 release. But when I start updating, After downloading all patch files, while restarting, it shows following error:
I searched almost everywhere on Google and Stackoverflow. There are already two questions on so: this and this. But none of them are have any correct answer. I also tried running as administrator, restarting PC, turning off the firewall, uninstalling antivirus. But none of them worked.
I am using windows 7 32-bit. How to solve this problem? Can anyone help?
I know this is an older question but I encountered the same error while updating SDK components in Android Studio 2.3.3. I was able to fix the problem by starting the SDK manager and un-checking the components that showed the error and clicked "Apply". That un-installed just that component. When it was finished, I re-checked the component and clicked "Apply" again. When it was finished, the problematic component was updated to the newest version. This was much quicker than doing a full un-install/re-install as stated in one of the solutions above.
Hope this helps someone.
This is another option, it is not much easier than reinstalling but at least you don't have to worry about your settings getting lost
Go to help->about and note the version you currently have installed
Download zip file for your current version at https://developer.android.com/studio/archive
Manually overwrite conflicted files with files from zip
Update normally
I had a similar problem on some other files and could not figure it out.
You should download the last Android Studio version and remove the old one.
It appears like the only way to bypass this error and successfully update Android Studio is to uninstall and reinstall it.
Before uninstalling, make a backup of your IDE settings through File | Export Settings.
Download the "No SDK tools included" exe from the Other Downloads section. Avoid using download accelerators as they often mess up the downloads from https://dl.google.com .
In the Install Wizard, you may uncheck to update AVD if you use Genymotion and don't need Google's Android emulator.
Use the JetBrains Toolbox for Android Studio update, problem solved. No need to mess with the file permissions. Especially on company devices.
I had this issue on Ubuntu 18.04 when tried to update Android Studio from 3.4 to 3.5 version. I have changed Android Studio directory's ownership to my user:
sudo chown -R <username> /opt/android-studio
It resolved all but one errors for me, because I still had a jre/bin/java - Access Denied error, which I have resolved by killing its process:
# The second column of this command's output is PID.
ps -aux | grep /opt/android-studio/jre/bin/java
kill <PID>
It might also happen that you need to logout and and re login as admin user in your system.
Update the Android studio [in admin user].
Re login as a previous user.
You should check the JDK Location settings, which appears be changed on every Android Studio update, with commands ctrl + Alt + Shift + S (to reveal the Project Structure menu options, and uncheck the Use embedded JDK and find your current JDK Location, on windows machines, you can see that location on environment variables JAVA_HOME.
There is a workaround, try deleting or moving the files that are causing the conflicts to another folder when the Update starts NOT BEFORE! That worked for me.
I know this is a very old question, but I face this issue almost every time I try to update my studio. Only solution I know which works for sure is clean install of studio....which is time consuming. So the solution is when you get to know the name of the file, search the location of that folder containing specified file. Check if that folder has lock icon on it, if it has then change the sharing settings to everyone and share the folder. If it does not have the lock icon on the folder check if it is in read-only mode. This worked for me hopefully someone finds this useful.
Cheers.
I had a similar problem. What I did was to make sure of the whole folder's ownership. For some reason, some files where owned by root, so I changed it to my ownership. In linux you can use the followoing command on the Android Studio folder:
sudo chown yourusername:yourusername -R android-studio-folder
I just tried again and everything updated successfully. Hope it helps!
The only solution worked for me is I have reinstalled Android Studio the latest version without uninstalling manually it and when starting the installer it asked me to uninstall and said that your settings will not be lost so I checked the uninstall and everything went smooth without any problems and got the latest version installed and all my settings the same.
I had this symptom when updating from Android Studio 3.4.2 to 3.5.
In my case, the affected file was plugins/Kotlin/kotlinc/bin/kotlinc.
The cause turned out to be that while the file's contents had not been modified at all... the Unix permissions bits on it had been.
Specifically, this was a file that comes as non-executable, and I had at some point chmod'd it to executable (because it should be) in order to use it from the command line.
The fix was to set those permissions bits back, with chmod:
$ chmod a-x /PATH/TO/android-studio/plugins/Kotlin/kotlinc/bin/*
This probably isn't a super common cause for this symptom, but hopefully it will be helpful to someone else. :-) I certainly didn't remember making that change, though once I spotted it I know exactly why I made it.
You can found the files in the android-sdk folder, and delete those files, and check your permission of the folder(android-sdk, build-tools, tools), if your can write, and download again.
I solve the issue.
I had the same error when upgrading from 3.1.x to 3.5.x. What worked for me was downloading the new Android Studio image from https://developer.android.com/studio and installing it (when asking me if I want to replace the old version I said yes). Everything seems to work fine now.
I also had the same error when upgrading from 3.5 to 3.6, I managed to solve this without losing any sdk platforms and virtual machines in avd by installing the latest version of android,First Export the settings and then delete the two folders ".AndroidStudio3.x" in home directory and the "android-studio" in /usr/local or /opt directory, then download the zip file of latest version of android studio and move the "android-studio" folder to /usr/local or /opt. Now run the /android-studio/bin/studio.sh and import the settings,Now Latest version will be installed.
I got this error when I was trying to upgrade Android Studio using a different user account to the account that installed Android Studio (the account had admin privileges). When I switched to the account which installed Android Studio I was able to upgrade without this problem happening.
I have had a similar issue and solved it. Some documents were encrypted by the software installed on my PC, so updating to Android Studio 3.6 was not possible (in fact every update I have the same issue).
To solve it, just find those files in the Android Studio installation folder (probably Program Files/Android) and decrypt it. After that, you should be good to go. I hope it helps!

Resources