-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Project Wizard is flawed in multiple ways #158
Comments
Thanks for report, please make sure that you have Android SDK available. |
Thanks for the detailed report! I checked on this configuration:
And created the project from the multiplatform template:
Can't reproduce errors 1/4/5/6. Errors 3/7 need further investigation, not sure what is the cause. |
I tried to "fix" my android SDK but it seems that there was nothing wrong with it. Here are the steps I took:
It really seems that this problem is not related to an android sdk problem after all, or I am missing something obvious. I tried to further investigate the problem and found a little bit of new context:
I also noticed two additional "errors" in File -> Project Structure that might provide some more insight:
I hope all of this can shed more light on the problem! I'm not quite certain what you mean with "try on a clean configuration of IDEA, without importing the old settings". Should I re-install the IDE without referring to my config folder? |
Just wanted to add that I just tried this again with a fresh IDE installation. My scoop installation of IntelliJ IDEA Ultimate wasn't properly updating to minor releases, so I re-installed it. But most of the config options and plugins were restored because I have "Settings Sync" activated (tbh that was very convenient). All the errors persisted just as I have described them at first. For that reason, I can rule out that my IDE installation was broken in some way. What I can not rule out is that the problem is somehow linked to my IDE config and/or plugins. Does anyone know a safe way to revert all config options of IntelliJ to the default options, but being able to switch back to my old config later? |
To revert IDEA to default state you can just rename %APPDATA%\JetBrains\Idea* folder. To restore - rename the folder back. Don't know how it will work with "Settings Sync" though. Probably it should be disabled first. |
Okay, so I tried this again. I turned off the settings sync in the IDE, deleted config and system folder, did another clean re-installation, disabled all downloaded plugins and tried to set up the same basic project again. I ran into the same errors again. I don't know what's going on here. |
I fixed it. I did two things and apparently both played a role in resolving the problems. Firstly, I was still not sure about my Android SDK. I mean I specify its location in the project wizard, but I was still suspicious. Checking my environment variables, it turned out that I only had Secondly, I noticed that even though I specified the location of the SDK in the project wizard, it did not show up in Project Structure > SDKs. So I added it manually there. This, and some re-building and re-importing actually solved the problems. There are two reasons why I don't think the issue should be closed already:
|
To retest on plugin 1.5.30 |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
I hope this is the right place to report this, since the project wizard is technically part of the IntelliJ Kotlin Plugin, but the Compose for Desktop template is only related to this project and not to the kotlin plugin. If I'm wrong here, please redirect me.
The issue is that the "Jetpack Compose for Desktop - Multiplatform" project template produces a new project that already contains multiple errors. Here's a list of steps to reproduce and the errors that appear at the different stages:
-> Error 1: During the Gradle Import, the following warning appears:
-> Error 2: During the Gradle Build, the following warning appears:
-> Error 3: During the following gradle tasks:
:common:compileDebugJavaWithJavac
:android:compileDebugJavaWithJavac
:common:compileReleaseJavaWithJavac
:android:compileReleaseJavaWithJavac
the following warning appears:
-> Error 4: test/android/src/main/java is not marked as Sources Root, therefore Inspections are greatly reduced for this file
-> Error 5: IntelliJ cannot find any of the imports, this causes 10 code errors in total. The imports affected are:
com.example.common.App
android.os.Bundle
androidx.appcompat.app.AppCompatActivity
androidx.compose.ui.platform.setContent
-> Error 6: IntelliJ marks
getPlatformName()
as error because "Actual function 'getPlatformName' has no corresponding expected declaration". Apparently, theexpect
declaration attest/common/src/commonMain/kotlin/com.example.common/platform.kt
is not found.-> Error 7: The directory is not marked as a module root, but instead the two subdirectories "kotlin" and "resources" are marked as module roots and test sources root. The displayed module name for "kotlin" is "androidAndroidTest" and for "resources" it's "androidTest".
As far as I know, those are all errors or weird behaviours that appear in a fresh project from the "Jetpack Compose for Desktop - Multiplatform" template that has not been edited in any way.
I'm quite confused about why I am getting all these problems in a fresh project, moreover I'd like to know how I can fix them. The gradle build seems to work (ignoring the warnings) and the sample desktop application works as expected. However, the unavailable and/or erroneous inspections for android-related modules make it really hard to properly work with Jetpack Compose for Desktop. If the error is somehow related to my configuration (although I mainly sticked to the standard), please tell me how to change it in order to fix the problems.
Environment:
The text was updated successfully, but these errors were encountered: