Comments (25)
I'm facing the same issue as @ggoraa, and my settings.gradle.kts
is identical to that found in the Getting Started guide:
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}
from compose-multiplatform.
We had similar problem earlier:
#21
And fixed it with #30
(we moved buildscript from settings.gradle.kts to the root build.gradle.kts and the problem was gone)
Do you have buildscript in settings.gradle.kts?
from compose-multiplatform.
Same issue :(
from compose-multiplatform.
Can you tell which versions of IDEA and Kotlin IDEA plugin do you use?
If it is possible it would be very helpful if you attach project archive here.
from compose-multiplatform.
Intellij IDEA: 2020.2
Kotlin (plugin): 1.4.10
JB Compose: 0.1.0-m1-build62
JDK Version: 11.0.8
JVM Target: 1.8
from compose-multiplatform.
Same issue.
It happens after creating multiplatform projects from intellij.
Intellij IDEA: 2020.3 EAP
Runtime version: 11.0.8
VM: Open JDK [64bit]
Repro: https://gofile.io/d/WpJQbh
from compose-multiplatform.
Intellij IDEA: 2020.2
Kotlin (plugin): 1.4.10
JB Compose: 0.1.0-m1-build62
JDK Version: 11.0.8
JVM Target: 1.8
Unfortunately I can't reproduce the issue on this configuration.
I tried to open these templates:
https://github.com/JetBrains/compose-jb/tree/master/templates/desktop-template (which is almost the same as described in https://github.com/JetBrains/compose-jb/tree/master/tutorials/Getting_Started)
https://github.com/JetBrains/compose-jb/tree/master/templates/multiplatform-template
Can anyone that have this issue attach archive with project?
Also is there "-Xuse-ir" in Project Settings?
It should be added automatically after the import of the project.
If not - will it be added after Gradle Sync?
from compose-multiplatform.
Repro: https://gofile.io/d/WpJQbh
from compose-multiplatform.
Strange enough, The same thing happens with the desktop-template project as well when (importing in Intellij).
from compose-multiplatform.
I don't have any issue with desktop-template based project. It only happens on MPP template for me.
from compose-multiplatform.
Repro: https://gofile.io/d/WpJQbh
Multiplatform template from IDEA Wizard currently have this problem (we fixed it in a new version)
Try this:
demo.zip
I changed version to "0.1.0-m1-build62" and converted desktop module from kotlin("jvm") to kotlin("multiplatform")
(kotlin("jvm") doesn't work well in multiplatform project)
from compose-multiplatform.
Got new error after tyring to run desktop app,
Repro: https://gofile.io/d/WpJQbh
Multiplatform template from IDEA Wizard currently have this problem (we fixed it in a new version)
Try this:
demo.zipI changed version to "0.1.0-m1-build62" and converted desktop module from kotlin("jvm") to kotlin("multiplatform")
(kotlin("jvm") doesn't work well in multiplatform project)
Got new error after trying to run desktop app: Gradle > desktop > Tasks > application > run
https://pastebin.com/0MWuepJe
But it works fine if I replace
import me.subash.common.App
import androidx.compose.desktop.Window
fun main() = Window {
App()
}
with
import androidx.compose.desktop.Window
import androidx.compose.material.Text
fun main() = Window {
Text("Hello")
}
from compose-multiplatform.
Got new error after tyring to run desktop app,
Repro: https://gofile.io/d/WpJQbh
Multiplatform template from IDEA Wizard currently have this problem (we fixed it in a new version)
Try this:
demo.zip
I changed version to "0.1.0-m1-build62" and converted desktop module from kotlin("jvm") to kotlin("multiplatform")
(kotlin("jvm") doesn't work well in multiplatform project)Got new error after trying to run desktop app: Gradle > desktop > Tasks > application > run
https://pastebin.com/0MWuepJeBut it works fine if I replace
import me.subash.common.App import androidx.compose.desktop.Window fun main() = Window { App() }with
import androidx.compose.desktop.Window import androidx.compose.material.Text fun main() = Window { Text("Hello") }
I forgot to change version in android/build.gradle.kts and common/build.gradle.kts
(you can redownload demo from a comment above, I changed the version)
from compose-multiplatform.
Do you have buildscript in settings.gradle.kts?
I have just copy pasted all code from your getting started guide, and the IDEA just gone wild with errors.
EDIT: I moved pluginManagement
part to build.gradle.kts
, aaand... Everything just broke. Maybe I misunderstood you :D
from compose-multiplatform.
Multiplatform template from IDEA Wizard currently have this problem (we fixed it in a new version)
Try this:
demo.zip
Forgot to say, I have the Kotlin/JVM project, not the MPP one
EDIT: Also forgot to say:
Kotlin plugin: 1.4.10
JVM target: 11
JDK: OpenJDK14
IDEA: Latest stable
from compose-multiplatform.
If it is possible it would be very helpful if you attach project archive here.
Easily. https://drive.google.com/file/d/1VRKk64t8z7GwYD6H2bp1hoF6z7nzYqFq/view?usp=sharing
from compose-multiplatform.
What exactly version of IDEA? 2020.2.3?
from compose-multiplatform.
This is what I did to fix the problem: Went into project structure, I had "Use project settings" ticked so I clicked on "Edit project settings" and changed Target JVM Version to 11, then added -Xuse-ir
to the command line options, after these operations red lines were gone. Screenshot of my project settings:
EDIT: I'm using 0.1.0-build113
btw
from compose-multiplatform.
What exactly version of IDEA? 2020.2.3?
yes
from compose-multiplatform.
I upgraded to the latest build of JetBrains Compose plugin, added the command line argument, and it is finally working! No more red lines :D
from compose-multiplatform.
If it is possible it would be very helpful if you attach project archive here.
Easily. https://drive.google.com/file/d/1VRKk64t8z7GwYD6H2bp1hoF6z7nzYqFq/view?usp=sharing
I changed the Gradle version from 6.3 to 6.5.1 and red underlining is gone.
On Gradle 6.7 and Compose 0.1.0-build113 everything is fine too.
from compose-multiplatform.
I will try this too
from compose-multiplatform.
I also forgot that my target JVM version was 1.6, after the upgrade to 11 every single error is gone
from compose-multiplatform.
It seems that everything is ok on the latest Gradle (6.7.1), Compose (0.2.0-build129), Kotlin (1.4.20) and Idea (2020.2.3).
We shouldn't manually add "-Xuse-ir" in project settings. It should be added automatically after Gradle Sync.
So if no one encounters this issue again I think we can close it.
Also if it still an issue, maybe similar changes will help:
https://github.com/JetBrains/compose-jb/pull/30/files
from compose-multiplatform.
My solution:
build.gradle.kts
plugins {
val kotlin = "1.5.0-M1"
kotlin("jvm") version kotlin
}
tasks{
val java: String by project
withType<KotlinCompile> {
kotlinOptions { freeCompilerArgs += listOf("-Xskip-prerelease-check", "-Xjsr305=strict"); jvmTarget = java }; sourceCompatibility = java; targetCompatibility = java
}
}
from compose-multiplatform.
Related Issues (20)
- [iOS] Resource not found. Run 'pod install' to update the copy resources script HOT 1
- Unresolved reference: Test
- Compose-Multiplatform Resources for ios doesn't work with Moko-Resources HOT 5
- MissingResourceException: Missing resource with path: drawable/photo.png HOT 6
- Desktop: Tooltip cancel the timer instead of restarting HOT 1
- [Web] incorrect windosw size in high resolution monitor HOT 1
- Add support for wlr-layer-shell
- Compiler support for Kotlin 2.0.0-Beta5 HOT 3
- When the window width is adjusted, the width of the Button component also scales along with the container. HOT 5
- Regression with resources library in version 1.6.1 HOT 2
- WASM: native isCopyKeyEvent is not implemented
- AlertDialog on iOS doesn't respect defined Theme HOT 1
- Project fails to build on IOS because of org.jetbrains.compose.annotation-internal:annotation HOT 4
- Png resource dosent work anyMore HOT 1
- Make iOS-like animations in `navigation-compose` by default HOT 3
- Can't download compose artifacts' source code in the common code. HOT 3
- findNextNonWhitespaceSymbolsSubsequenceStartOffset crash HOT 1
- Code only desktop appearing in the common sourceset HOT 1
- Expose a scroll state in the BasicTextField in the common code HOT 3
- Building an iOS Application fails when using cinterop HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.