Qawaz / compose-code-editor

Display & Edit code with syntax highlighting in jetpack compose
https://qawaz.github.io/compose-code-editor
MIT License
67 stars 6 forks source link

Following "Android Only" tries to import JS #19

Closed Queatz closed 6 months ago

Queatz commented 6 months ago

Adding this to an Android project:

implementation("com.github.qawaz:compose-code-editor:3.1.1")

Results in this error:

Could not determine the dependencies of task ':app:lintVitalReportDebug'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.github.qawaz.compose-code-editor:codeeditor-js:3.1.1.
     Required by:
         project :app > com.github.qawaz:compose-code-editor:3.1.1
      > No matching variant of com.github.qawaz.compose-code-editor:codeeditor-js:3.1.1 was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'jsApiElements-published' capability com.github.qawaz.compose-code-editor:codeeditor-js:3.1.1 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
              - Other compatible attributes:
wakaztahir commented 6 months ago

That's because you added the wrong dependency

Please use this with github packages

implementation("com.wakaztahir:codeeditor:3.0.5")

The dependency doesn't exist at

com.github.qawaz.compose-code-editor:codeeditor-js:3.1.1

That's because this is the android jitpack repository, I could not get jitpack to work with multiplatform packages at that time, there were issues in jitpack and I haven't tried now. There's a version 2.0.3 and that's android only so there's it probably can't locate the JS package. So Please use Github Packages.

Here are the avaialble github packages https://github.com/orgs/Qawaz/packages?repo_name=compose-code-editor

Queatz commented 6 months ago

Maybe we should update the Readme