Error being thrown when trying to debug from JetBrains Rider: error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' - xamarin.ios

I am unable to debug a Xamarin.iOS application out of JetBrains Rider 2022.2.2. This is the error that gets thrown when trying to deploy to the simulator:
error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation):
dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation, 0x0001): Library not loaded: '#rpath/ContentDelivery.framework/Versions/A/ContentDelivery'
Referenced from: '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/DVTITunesSoftwareServiceFoundation'
Reason: tried: '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/System/Library/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file)

I had the same problem.
Let me guess... You just upgraded to XCode14 and the corresponding Command Line Tools?
Downgrading XCode and Command Line Tools to 13.4.1 helped me.
What worked for me
Go To https://developer.apple.com/download/all/?q=command%20line%20tools
Download XCode and Command Line Tools for Xcode 13.4. Unpack Xcode (13.4.1) and rename it (for example Xcode 13) and place it parallel to Xcode (14) in the programfolder.
.
Then install the Command Line Tool.
Now in Xcode (still 14) > Preferences > Location > Command Line Tools, select version 13.4.1 instead of 14. You can see the Path for it is "Application/Xcode 13".
For safety restart tools, and it worked again...
Update: With the last update of Visual Studio, the downgrade was no longer necessary for me. Since then I can build the apps with XCode 14 and the corresponding command line tools without any problems. So I suggest upgrading Visual Studio to the latest version first.

Here is how I made it work:
Download the former version here (note: you need a developer account)
Double-click on the downloaded .xip file to install XCode 13.4.1
Rename the newly installed XCode application into Xcode.13.4.1.app and move it into your Applications folder
Open the usual XCode application and go to the preferences
In the locations tab you will be able to select XCode 13.4.1 for Command Line Tools

Redownload Visual Studio?
It turns out Microsoft released a brand new Visual Studio at some point.
We haven't been in our Xamarin project for a while and even though it said there were no updates, no Simulators were showing up.
Our Visual Studio said the version was 8.10.25 yet when I was reading the release notes, they referred to version 17.3.7.
Our team had to download Visual Studio again and then we saw the version updated to 17.3.7.
So check your version of Visual Studio and redownload the newest one. That's what fixed this issue for us.

Latest update fixed the issue for me.
I had the same issue, while searching for answer I found this thread,
writing this to confirm that I took the latest update on 9th nov(NET 7 SDK). Issue seems resolved with latest update.

There is a more elegant solution to this problem. You need to upgrade Xamarin.iOS manually. The releases are on GitHub 16.0.0.72 did the trick for me.

Related

Newest Android Studio 2021.3.1.17 release gets stuck on launch screen

I've installed the newest version of Android Studio with the installer on my Windows 10, currently it's version 2021.3.1.17 Dolphin.
Upon launching it, the splash screen appears and the little bar loads to the end and then it gets stuck indefinitely on that screen. All I'm seeing is this:
I've tried the following stuff already:
Completely uninstalling Android Studio, making sure all the files have been removed correctly before re-installing it (except the JetBrains folder, since I have other JetBrains stuff in it)
Re-Downloading the installer from the official Android Studio Website to make sure it was not corrupted.
Run as Administrator.
Was previously installed on a non-primary drive D:/, and I've also tried installing it on my primary drive C:/ just in case, same issue with C:/ installation too.
Ran studio.bat to see any errors, however, I'm assuming that bat file itself is buggy. It tells me that it does not find any JRE or JDK installation within the path. So to fix it I've set the newest Oracle JDK19 as my JAVA_HOME and the /bin accordingly, however, the studio.bat will then continue a long java error which seems honestly unfixable, so I won't even bother posting it here. Me setting the path shouldn't even be necessary, as Android Studio comes bundled with a JDK... and it should be using that one anyway.
So I'm out of things to try. I cannot make it work. My only lead was the Java error, but according to some Google search, I shouldn't even have to deal with it as it comes bundled with Android Studio. Looking into the files, there is indeed a jre folder within the Android Studio installation. Is it not using that one? What could be the reason that it is not using it if that is the case?
So, I was able to fix it myself after trying a few hours more. I've had also other Java installations (Java JDK 8, JDK 19) that interfered somehow with Android Studio. I've uninstalled everything related to Android Studio and I've uninstalled every Java version I had.
Additionally, I've removed every reference to Java or Android Studio from all of my system and environment variables. Also removed a path to Android SDK that was within my system variables.
After rebooting and installing Android Studio, it worked. Haven't installed any Java version so far, so not sure if the issues will return if I install my Java versions again.

Android Studio ArticFox compiling fine but showing red errors everywhere

I have a multi module Android Compose project. One module is an android app, others are android libraries or kotlin libraries. I'm running AS Artic Fox 2020.3.1 Beta 5 on MacOS 11.4 Big Sur.
After a library upgrade (probably AGP to use compose, I don't remember when exactly) Android Studio started to show syntax errors everywhere, both in .kts and .kt files.
Compilation and execution are working fine, only those weird JDK errors are displayed.
Here are some examples :
in a .kt file from a kotlin library module, in a .kts file from the buildSrc module
It seems that there is an error with the JDK somewhere, but I don't understand how to fix it.
I Googled/StackOverflowed before posting here and I already tried :
to check the JDK used Project Structure > SDK Location > Gradle. It is using the Embedded JDK 11.0.10
to reinstall AS using Jetbrains Toolbox
to invalidate cache and restart
to clone my project again
to delete ~/.gradle
But none of those actions helped...
Thanks in advance !
Update 22/07
I tried to create a new empty Compose project with .kts support, but no luck, everything is in red
Because of a bug preventing to update, I updated manually to RC_1. Here is my current setup.
I tried to change from Embedded JDK to a separately installed OpenJDK 11 and reimport but not luck (#alexey-belkov suggestion)
I checked the logs but found nothing obvious (#andy suggestion)
ℹ️ Finally I tried to create a new empty Android project with only .gradle support, and no errors ! Could it be a kotlin script plugin problem ?

Not able to connect adb after upgrate Android Studio to 3.4

unable to connect to adb.check the event log for a possible issue, verify that localhost entry is pointing to 127.0.0.1 or:: 1 for ipv4 or ipv6
Tried adb kill-server, restart, invalidate restart nothing works.
Same issue reported over here https://issuetracker.google.com/issues/130791561
Note: I have not added any file or anything in studio, it's fresh installed Studio after format a full system still issue is there.
Replace your platform-tools with this one and delete the other one.
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
I was also facing this issue in android Studio 3.4 version, but now I have fixed it , if you are using windows then follow these steps:
Download Platform tools from here
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
Extract downloaded zip file
Go To location "C:\Users\your_computer_user_name\AppData\Local\Android\Sdk" and Delete "Platform tools" folder
Copy and Paste, downloaded platform tool folder to above location
Now Go to your android studio and Rebuild your project Then run.
For Mac Users, follow these simple steps :
Just simply Navigate to Tools > SDK Manager> Android SDK>, then click on the Tab of SDK Tools, then look for Android SDK Platform-tools and update it.
Then the last step, Invalidate cache and restart your IDE, after that, then finally you restart your Mac. (Sometimes it's this step is unnecessary)
It will work out successfully.
Solution for Linux Users.
System info: Linux Mint Cinnamon 19.1 , Android Studio 3.4.1
Issue description: Problem with platform tools.
Solution: Remove the folder manually and update SDK tools through Android Studio.
Step 1: Go to your Android SDK installation folder. By default under your home directory. Choose platform-tools and simply delete. (/home//Android/SDK)
Step 2: Open Android Studio and go to SDK Tools. (File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK -> SDK Tools) By the moment you should be able to see Android SDK Platform Tools line unchecked.
Step 3: Put a check to install Platform Tools and press OK. Notice it'll relocate the folder to the directory where deleted.
Now that you re-installed the platform tools, restart the Android Studio and your deployment targets should show up.
If you don't install the platform tool back and ever try to build or run a project you'll get this IDE error. Just FYI :)
So that's all. Enjoy.
Happy coding
If you use Windows, you might have a corruption in api-ms-win-crt-runtime-l1-1-0.dll.
Try to update it - you can get the update from Microsoft's website.
You should check it - path/to/sdk/platform-tools and try to run adb.exe
When you update Sdk platform tools(which contains adb.exe) to release 28.0.2 and if you are using windows 8.1 then it needs few updates from windows.
As per SDK Platform tools release notes(https://developer.android.com/studio/releases/platform-tools):
Updated Windows requirements : The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package."
Windows update url: https://support.microsoft.com/en-ca/help/2999226/update-for-universal-c-runtime-in-windows
Prerequisite for Windows update url: https://www.microsoft.com/en-us/download/details.aspx?id=42327
Faced the exact same issue but after updating with prerequisite url first then the other url provided now it is working perfectly fine for me.
It worked for me by selecting -> Use libusb backend
This worked for me on Windows:
Goto cmd write %temp% hit enter -> delete all data from there.
Restart your Computer.
Open Android Studio now, it will work.
Clear all cache memory (related to Android Studio)
Restart ADB manually from Android Studio (first option)
Open Command prompt and got android sdk>platform-tools> adb kill-server
press enter
and again adb start-server
press enter
Restart ADB manually form Android Stidio (second option)
go to your (SDK store path) sdk>platform-tools>adb
press enter
ex. D drive > sdk>platform-tools>adb
Restart your system
Delete the platform-tools folder from the sdk and replacing with the same from your another pc. I am also facing this problem after updating to 3.4. If you face same problem please update to Android Studio 3.5 Canary Channel.
The reason is for ADB server problem. Simply re-run your adb.
(Go to your SDK folder then inside platform-tools folder you can see adb.exe. copy the path location and paste it in your computers system Environment variable. Set a new path there and paste the adb.exe file location there. hope it will solve )
If you are using Genymotion, there is an update that fix the problem.
Genymotion 3.0.2 (April 18th, 2019)
Corrections
We have fixed an
incompatibility with the adb tool bundled in the platform-tools 28.0.2
package of the Android SDK, which caused failures to start virtual
devices.
This new version of adb changed the behavior of the “adb connect
:” command by making the “port” part mandatory. This
broke Genymotion Desktop in a few places where it did not pass the
port. We have adjusted the way we call “adb connect” and also updated
the version we ship with the product to match the one in
platform-tools 28.0.2.
If non of the above answers worked for you (as same happend to me), down grade to the old version of Android Studio by following these steps:
Uninstall current Android Studio
Go to Android Studio Archive and download any older version
After installation, Open the project. You might see an error like this
This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
Now, open project gradle and update classpath tools.build version. I.e. in my case Android studio version is 3.2 and classpath 3.2.1
Hope it might save someone time.
I faced this issue last night, and I tried these methods to fix:
download older platform-tools and place it in the android sdk folder.(not work for me)
adb kill-server, adb start-server.(not work for me, adb had no response with these cmd)
kill the process that occupies port 5037.(for me, there is no other .exe run at this port)
reinstall platform-tools in Android Studio.(not work)
download ADB Kits and replace them in platform-tools folder.(work!!!)
It seems that my adb file has been modified or replaced by some programs. You can try these methods, and I hope some of them can work for you.
I had this issue only after a Genymotion update, on Mac.
What worked for me: Open Genymotion preferences, Select ADB, choose "Use custom Android SDK tools" and points to your Android SDK folder.
Actually the problem is not with the android studio version 3.4
Problem is with the android platform tools version which is latest one 29.
So install the previous version of the android platform tools version it will solve your problem. as above #Ved mentioned.
Ved link:
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
EndTask adb.exe from Background processes (TaskManager) and Run Application again.
It works for me

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"

Android Studio won't create a class

Why won't Android Studio create a class?
It doesn't even work for newly created projects
Update
OR why are all of these empty?
The reason is you may have installed the 64 bit version on a 32 bit machine. I had the same problem. If you have 32-bit OS, try to uninstall 64-bit version of Android Studio and install 32-bit version from this page: https://developer.android.com/studio/index.html#downloads
I too faced the same Issue. Go to your Android Studio -> Help -> Edit Custom VM options. Add the following line to the opened file.
-Djdk.util.zip.ensureTrailingSlash=false
Source : Fix suggested by Wojciech Fred
To me, the problem was due to incorrect upgrade to new version of Android Studio. Studio patching seemingly went ok, but at Event Log, I constantly got this error:
2:55 PM FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in /home/vlada/android-studio-145.3200535/lib/idea.jar
I also got similar message in 'IDE Fatal Errors' window.
Downloading and installing the latest version of Studio solved the problem for me.

Resources