Navigation graph not appearing in Android Studio 3.5 - android-studio

With Android Studio 3.5, I'm trying to create a navigation graph, but the design view is empty
I know this was an issue with 3.2 but its just not working in 3.5.
In my project build.gradle file I'm using
navigationVersion = '2.1.0'
In my app build.gradle file, I have it listed as
// Navigation Components
implementation "androidx.navigation:navigation-fragment-ktx:$rootProject.navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$rootProject.navigationVersion"
Update:
Re-installed Android Studio on my Mac after deleting all the cache , library files etc ... Still no luck.
Tried to create another new project and I see the design view displaying the fragments.
Any tips on where to compare the differences between both projects ?

This project was migrated from before I moved everything to AndroidX. After removing the following line from the gradle file ... the design view appeared.
androidTestImplementation "android.arch.navigation:navigation-testing:$rootProject.navigationTestVersion"
Looks like Android Studio gets confused when it sees the older navigation dependency in the gradle file.

Related

Android Studio Designer Preview went Black after implementing Material Components library

I am new in Android Development. In the latest version of Android Studio I want to use Material Components for my app. But after implementing its gradle script my Android Studio Designer Preview went black/blank. As you can see in screenshot below.
I have implemented the following line in my build.gradle
implementation 'com.google.android.material:material:1.4.0'
After removing the material components library the preview looks as it should.
I have also tried to restart Android studio as well as my computer.
I just realised that I have used
implementation 'com.google.android.material:material:1.4.0'
instead of
implementation 'com.google.android.material:material:1.4.0-rc01'
Now the issue has been fixed.

How to configure an iOS Application for Kotlin Multiplatform in Android Studio?

I want to add a Run/Debug Configuration for an iOS Application for a Kotlin Multiplatform Mobile application in Android Studio 4.1.2. However, there seems to be a problem with the configuration for iOS.
In the screenshot below you can see the problem. In the dialog "Run/Debug Configuration" Android Studio complains about
Error: Please specify Xcode project location in xcodeproj property of gradle.properties
Using the "Fix" button does not solve the problem. Android Studio just adds an additional xcodeproj to gradle.properties and the complains about a duplicate parameter.
I also tried different paths (relative and absolute) for xcodeproj. No luck.
If I remember correctly, it used to work out of the box. A new Kotlin Multiplatform Mobile project was automatically configured for Android and iOS. I'm not sure what changed. Probably something was updated.
Is this a bug with the KMM plugin? Or is there something I can do on my system to fix this?
don't do that with Android Studio.
Just open Xcode, click on 'open another project...', locate to the iosApp folder that named it when creating your project on Android Studio.
after that, just click run and have fun.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode
Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
I fixed it by downgrading the Kotlin version from 1.4.30 to 1.4.21. You can check this thread here. To downgrade, download the version you want from the plugin store and choose the install plugin from disk as in the picture below
Upgrading Android Studio version to 4.2.1, KMM plugin version to 0.2.6, creating new KMM project with KMM plugin, the problem can be fixed automatically.
If you don't wanna use Xcode:
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions
Same as here: https://stackoverflow.com/a/66941077/3117650
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions

Why is android studio decompiling classes from my projects when I open them?

Android Studio was automatically updated on my system to to 4.0.1, from version 3.2, however since I found that 4.0.1 had potential bugs, I installed a previous version (3.5.3) and I when opening one of my projects which is only a small simple test project and seemed to take an age loading, the last dialog, I see before it opens is
Title: "Loading Project..."
Body: "Decompiling class CountDownTimer.class
when in previous versions I haven't seen this behaviour and I cant find any "decompiler" options in Settings either and the question is Why is Android Studio decompiling my class files, by default? why would it need to? what is the rationale?

why in android studio 3.6.2 RecycelerView Does not work?

I updated Android Studio to version 3.6.2 and after adding the RecycelerView, I realized that it is not displayed in the design tab!
There are various reasons for Design tab fail to render layouts.
Try changing the API levels in the design views.
Clean build your project by going to Build > Clean build
Ensure you don’t have any file from SDK that is missing
Still if android studio is not able to render your layout then try by going File > Invalidate Cache/Restart

Android studio doesn't create project structure

I am new to Android studio. I tried to create my first project and there is no project structure only gradle files. What am I doing wrong? I keep getting these files with creation of another new project.
Update SDK via Android SDK Manager. You need all packages in Tools to be installed.
But even after doing so, I can't make it to auto generate resources. So I continue to deal with it...
I found what was my problem. I updated Android studio from version 1.x to 2.x. On official site is written that if you try to install version 2.x into same location Android studio might not work properly and there could be some unexpected behavior.
So just removing Android studio and then reinstaling it, worked perfectly.

Resources