Android studio adds wrong xcodeproj location in KMP/KMM/KN - android-studio

I'm trying to run both a brand new KMM application, and an existing KMM application I had created before, and when I try to run the iOS version out of Android Studio I don't have an iOS configuration.
When I go create an iOS configuration I get an error that must be fixed first. When I push on "fix it" button, the gradle.properties file creates a new line of xcodeproj=iosApp/iosApp.xcodeproj
This is both wrong, and duplicated.
If I remove either of the duplicated xcodeproj lines, the error continues and I get a new line when I fix it (again).
If you repeat this process you can also end up with many of the new xcodeproj lines, all with the wrong location.
Modifying the location to the correct location also doesn't solve the problem.
Any thoughts? Seems like a bug in Android Studio 4.1.2.
Here are the details of the Android Studio version:
Android Studio 4.1.2
Build #AI-201.8743.12.41.7042882, built on December 19, 2020
Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true, debugger.watches.in.variables=false
Non-Bundled Plugins: com.intellij.lang.jsgraphql, org.jetbrains.kotlin, com.jetbrains.kmm

Related

Android Studio using all the CPU and becoming unresponsive

I'm not doing anything intensive with AS - just working through developer.android.com/codelabs/android-room-with-a-view-kotlin
I've increased the ram available for AS to 4GB, but that hasn't helped. It just bogs down after a few minutes use, and I can see in the task manager that it is using up to 97% of the CPU. I've got a pretty decent laptop, 16Gb ram - and have used older versions of AS to create java apps without issues. This is my first effort with Kotlin, and first time with this version of AS.
I just have to close AS with the task manager and restart it, but I'm not getting any work done before it freezes again.
Android Studio Dolphin | 2021.3.1 Patch 1
Build #AI-213.7172.25.2113.9123335, built on September 30, 2022
Runtime version: 11.0.13+0-b1751.21-8125866 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.instant.shutdown=false
Non-Bundled Plugins:
com.intellij.marketplace (213.7172.48)
com.thoughtworks.gauge (213.5744.125)
com.developerphil.adbidea (1.6.8)
How can I find out what's going wrong?
Thanks.
I found a solution for Windows:
The problem was with Android Studio itself not deleting all the folders when fresh reinstalling it. So, you must do so manually:
Backup your project
Uninstall Android Studio
In "Windows Explorer" enable the option "Hidden items"
Go to C:\Users[your_name]\AppData\Roaming\Google
Delete everything inside the folder
Go to C:\Program Files\Android
Delete everything inside the folder
Reinstall Android Studio (if prompted to import settings select "no")
If you have any other problem, comment below, and I will try to help you with the best of my knowledge.

Android Studio complaining Gradle version is too low

Android Studio is complaining that Gradle version is too low
Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.2. Current version is 7.0.
But when I check my Gradle version in Project Structure it's clearly v7.2
I have checked for Android Studio updates and there are none.
I have invalidated caches and restarted
I have rebooted system and started Android Studio
So why is Android Studio complaining and how do I remedy
Android Studio details
Android Studio Bumblebee | 2021.1.1 Patch 2
Build #AI-211.7628.21.2111.8193401, built on February 17, 2022
Runtime version: 11.0.11+0-b60-7590822 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.3.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true, ide.images.show.chessboard=true
In Project explorer in the .gradle folder there are multiple version folders.
You should try File ->Invalidate caches / Restart.
Two files change when gradle version is changed
build.gradle
classpath 'com.android.tools.build:gradle:7.1.2'
gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-7.2-all.zip
You can check these two files whether they are changed according to new version

How to successfully Restart App Inspection in Android Studio Bumblebee

Im trying this version of Android Studio
Android Studio Bumblebee | 2021.1.1 Beta 4
Build #AI-211.7628.21.2111.7905991, built on November 11, 2021
Runtime version: 11.0.11+0-b60-7590822 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.0-release-798-AS7442.40)
I realise its a Beta release, however Im having difficulty with the App Inspection tool.
Its fine at the start of the day, once I have stopped it and attempt to restart it consistently fails.
Ive tried closing and reopening Android Studio, restarting Android Studio, invalidating cache and restarting Android Studio, clear file system cache and local history and restarting Android Studio
none of these actions can resolve the error state of
Could not launch inspector androidx.sqlite.inspection: Inspector with the given id androidx.sqlite.inspection already exists. It was launched by project MyProject
Is there an approach I should be taking to resolve this issue?

Installing Kotlin Plugin 1.4.31 causes Android Studio to not highlight syntax errors for a single file

Syntax error highlighting isn't working for a single file in my project. I've tried:
Restart Android Studio
Restart Computer
Invalidate Caches and Restart
Clean and Rebuild Project
Sync Project with Gradle Files
Make sure I am not in Power Save Mode
Run Analyze -> Inspect Code on the file in question (no errors found)
I don't see any plugin errors when starting up Android Studio
If I make a syntax error in any other file, the offending piece of code is underlined immediately in red. When I build, the build fails because of the syntax errors.
Android Studio Info:
Android Studio 4.1.2
Build #AI-201.8743.12.41.7042882, built on December 19, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1246M
Cores: 4
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: com.thoughtworks.gauge, org.intellij.plugins.markdown, com.intellij.marketplace, org.jetbrains.kotlin
Reported as a bug here: https://issuetracker.google.com/issues/181717941
This is fixed by File -> Manage IDE Settings -> Restore Default Settings
It can be reproduced by installing the new Kotlin plugin

New install of Android Studio 3.2.1 create basic project error

Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 9, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
When installing Android studio and then creating a basic project with a basic Activity this is what happens, look at the pictures:
Invalidating cache and Restart in the File menu makes no changes.
I uninstall Android Studio making sure all folders are gone like C:\Users\user.AndroidStudio3.2
Installing a fresh copy Android Studio 3.2.1 but still this error
ERROR OUTPUT
DUBLICATE MENU ITEMS
MISSING AVD and SDK
MAKE MAKE
Under Build, click on Build APK(s). If you do not have APKs installed, install them. There is Generate APK under Build too. Check your Gradle files for any added repositories you need to use. Also check that you have installed SDK of your choice.

Resources