hi, were someone able to check the genResources-no...
# korge
p
hi, were someone able to check the genResources-not-found-folder bug on the 2.0.0.2-rc2 plugin build ?
d
rc6 should be the last one before the final release. Can you check if the problem reproduces there? https://github.com/korlibs/korge-plugins/releases/tag/v2.0.0.0-rc6
👍 1
p
Excellent will check now
Shit that rc is big in changes!!! Congrats 👏👏👏
d
It is pretty big because that's the full changelog for 2.0 🙂 We are preparing everything else related to the release, but that one is using Kotlin 1.4.20 already and the libraries themselves are 2.0.0 already so it is pretty final already
p
not sure what’s happening, but it looks like the project has lost the ios/mac targets
d
Yeah, you have to put targetAll in the korge block
p
ahhh, good point
this way people won't have to download artifacts for stuff they don't need
p
that makes sense
//targetAndroidIndirect() // targetAndroidDirect()
what’s this ?
d
direct just applies the android plugin to the project, and puts the stuff in src/main
the indirect is the
build/platforms/android
separate project
p
👏
d
the separate project allows people to open it on android studio, and to not force other people downloading the project to have the androidsdk
p
👍 gotcha
getting this: Unable to load class ‘kotlin.KotlinNothingValueException’. Possible causes for this unexpected error include: Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart) Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
have you got something like this before?
maybe I have a problem with the dependencies definitions ?
d
KotlinNothingValueException happened to me when the gradle plugin was compiled with 1.4 instead of 1.3 since the kotlin embedded on gradle 6.7 is still 1.3
p
maybe it’s then actually a gradle cache issue ?
d
Copy code
korgePluginVersion
is 2.0.0.0-rc6?
p
Copy code
korgePluginVersion=2.0.0.0-rc6
it looks so
d
ah fuck
I compiled the plugin with kotlin 1.4.20
p
😂
d
I have to change it to use 1.3.x instead
p
np, at least we know what is it
d
uhm, just forgot that I need to use 1.4 since that's the compiler that is used,can you execute with
gradlew yourTask --stacktrace
to see where is that exception thrown?
p
of course, one second
Copy code
➜  tool_framework_multi_platform git:(master) ✗ ./gradlew installIosSimulatorDebug --stacktrace
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
Configuration on demand is an incubating feature.

> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: <https://kotlinlang.org/docs/reference/evolution/components-stability.html>. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.


> Task :iosCreateIphone FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not evaluate onlyIf predicate for task ':iosCreateIphone'.
> kotlin/KotlinNothingValueException

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleException: Could not evaluate onlyIf predicate for task ':iosCreateIphone'.
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:356)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.NoClassDefFoundError: kotlin/KotlinNothingValueException
        at com.soywiz.korge.gradle.targets.ios.IosKt.appleGetDevices(Ios.kt:883)
        at com.soywiz.korge.gradle.targets.ios.IosKt.appleGetDevices$default(Ios.kt:882)
        at com.soywiz.korge.gradle.targets.ios.IosKt$configureNativeIos$iosCreateIphone$1$1.isSatisfiedBy(Ios.kt:754)
        at com.soywiz.korge.gradle.targets.ios.IosKt$configureNativeIos$iosCreateIphone$1$1.isSatisfiedBy(Ios.kt)
        at org.gradle.api.specs.AndSpec.isSatisfiedBy(AndSpec.java:50)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:44)
        ... 24 more
Caused by: java.lang.ClassNotFoundException: kotlin.KotlinNothingValueException
        ... 30 more


* Get more help at <https://help.gradle.org>

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD FAILED in 7s
1 actionable task: 1 executed
d
yeah, in the same place I had it. But thought that in the plugin that was going to use Kotlin 1.3.72. Not sure why is that exception referenced at all
p
excellent man! thx for handling it đŸ’Ș
👍 1
so the failure is here? val res = Json.parse(execOutput(“xcrun”, “simctl”, “list”, “-j”, “devices”))
d
looks like
but I'm not using Nothing
is the parse line
Copy code
object Json {
   fun parse(s: String): Any? = parse(StrReader(s))
receiving a String and returning Any?
p
mmm weird
d
I think I'm going to decompile the bytecode and see where is the exception put to try to figure out if I can do something
p
is it possible to catch the java.lang.NoClassDefFoundError on that line ?
well, actually that’s useless
you need the execution of that method
isn’t there a replacement for the json.parse ?
maybe a manual parsing?
d
that class is manual parsing
I should use other thing like jackson or something
message has been deleted
Can't see
Nothing
on that class
p
so the deal is inside Json.INSTANCE.parse
d
ahh, seems to be part of the Json.class
but not sure why it doesn't appear on the stacktrace
message has been deleted
p
there is it little bastard
d
maybe I missed the inline in the private fun injvalidJson. Still going to use plain throw
will be available in like 4 minutes or so
p
Trying
d
you can publishToMavenLocal
p
was this method removed ?
Copy code
import com.soywiz.korge.font.readBitmapFontWithMipmaps
also with this:
Copy code
graphics {
    stroke(Colors["#FFFFFF"], Context2d.StrokeInfo(2.0)) {
Using ‘StrokeInfo(Double = ..., Boolean = ..., LineScaleMode = ..., LineCap = ..., LineCap = ..., LineJoin = ..., Double = ...): StrokeInfo’ is an error.
d
Yeah, StrokeInfo is now at the package instead of a subclass, and readBitmapFont now work with mipmaps directly
p
ok, were able to fix those two, and the compilation has advanced pretty much. Now the error is this one:
➜  tool_framework_multi_platform git:(master) ✗ ./gradlew installIosSimulatorDebug --stacktrace
Configuration on demand is an incubating feature.
Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add ‘kotlin.mpp.stability.nowarn=true’ to the Gradle properties.
Task :compileKotlinIosX64 FAILED
e: Compilation failed: Unbound symbols not allowed Unbound public symbol for public com.soywiz.korim.vector/Context2d.fill|4053777818031238570[0] * Source files: bootstrap.kt, Source.kt, CompositeDisposeBag.kt, Disposable.kt, Disposables.kt, InternalDisposable.kt, ColdEmitter.kt, Emitter.kt, HotEmitter.kt, SingleEmitter.kt, UndeliverableEmissionException.kt, UndeliverableNotificationException.kt, Observable.kt, Single.kt, AbstractObserver.kt, AllObserver.kt, CompleteObserver.kt, NextCompleteObserver.kt, NextObserver.kt, NextTerminalObserver.kt, Observer.kt, TerminalObserver.kt, CombineLatest.kt, DoOnEach.kt, Filter.kt, FlatMap.kt, MapOperator.kt, OnErrorReturn.kt, Operator.kt, OperatorExtensions.kt, SingleOperator.kt, SwitchMap.kt, BehaviorRelay.kt, BehaviorSubject.kt, PublishSubject.kt, Subject.kt, CommandType.kt, ToolExecutor.kt, ToolManager.kt, ToolTheme.kt, AudioType.kt, CircleType.kt, FileSystem.kt, Quadrant.kt, Screen.kt, SizeType.kt, SoundType.kt, ToolCallbackType.kt, ToolMode.kt, ToolType.kt, FloatExt.kt, GenericSceneExt.kt, IntExt.kt, KorviExt.kt, ObserverExt.kt, SceneExt.kt, ToolUtil.kt, UIExt.kt, Util.kt, AbstractTutorialStep.kt, Background.kt, BackgroundParser.kt, CircleDistibution.kt, GameFinishedToolCallback.kt, MediaContainer.kt, Settings.kt, SettingsParser.kt, Target.kt, TargetsParser.kt, ToolCallback.kt, TutorialListener.kt, GenericScene.kt, GenericTutorial.kt, Match.kt, QuadrantsCirclesDistribution.kt, SceneEmpty.kt, Statistics.kt, ToolModule.kt, Tutorial.kt, TutorialStep1.kt, TutorialStep2.kt, Tutorial.kt, TutorialStep1.kt, TutorialStep2.kt, TutorialStep3.kt, Tool.kt, Tutorial.kt, TutorialStep1.kt, TutorialStep2.kt, TutorialStep3.kt, TutorialStep4.kt, TutorialStep5.kt, TutorialStep6.kt, Background.kt, CircleHole.kt, CountDownScreen.kt, LivesArea.kt, MultiTouchComponent.kt, PTElementUI.kt, PauseButton.kt, PauseMenuButton.kt, PauseScreen.kt, SceneMarquee.kt, ScoreArea.kt, TargetPresentationScreen.kt, TargetUI.kt, TaskProgress.kt, TextBox.kt, TutorialBackButton.kt, TutorialRepeatTutorialButton.kt, TutorialSkipTutorialButton.kt, TutorialStartToolButton.kt, Video.kt, FontLoader.kt, GeometryUtil.kt, ImageLoader.kt, main.kt * Compiler version info: Konan: 1.4.20 / Kotlin: 1.4.20 * Output kind: LIBRARY e: java.lang.AssertionError: Unbound symbols not allowed Unbound public symbol for public com.soywiz.korim.vector/Context2d.fill|4053777818031238570[0] at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:93) at org.jetbrains.kotlin.backend.konan.PsiToIrKt.psiToIr(PsiToIr.kt:126) at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt:134) at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$psiToIrPhase$1.invoke(ToplevelPhases.kt) at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:97) at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$namedOpUnitPhase$1.invoke(PhaseBuilders.kt:95) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:30)
based on the following thread it seems that the issue is related to the kotlin version used to build the project: https://youtrack.jetbrains.com/issue/KT-41006 but havent you changed the korge plugin to use 1.3.72 on version 2.0.0.0-rc7 ?
can it be maybe related to Alenxader Udalov’s answer ?
d
Fuck. That Unbound symbols looks no good
and that happens with iOS? I believe I tried the other day and worked fine for me
but I did not use the tasks that were broken
p
i’m disabling all the calls to com.soywiz.korim.vector/Context2d.fill to verify there are other methods with the same problem
d
I had unbound symbols with old Kotlin/Native dependencies that required to recompile
p
do you want to take a look to the project source ?
d
is the one at github?
p
yeah, let me push the latest code
d
okay
let me boot the mac
p
pushed to master
👍 1
d
I'll check later but asap
p
👍 thx man
d
Hey Pablo, I tried it last night, and seemed that it was using korvi-rc2, and that referenced old libraries. Can you try again?
For me it booted on an iPhone simulator, though can’t find a resource. Maybe because of the Vfs root it is being used
p
of course, let me checl
you are the man 😄
it worked at once
i mean, i’m getting a pink screen because it’s not finding a resource from the commonMain/resources/ folder
Copy code
val toolSample = resourcesVfs["sample_tool_sa.json"].readString()
specifically this line is the problematic one
shouldn’t the resourcesVfs target to the resources folder?
it looks like the simulator search for the resources on a generated folder like this one: /Users/pablocaviglia/Library/Developer/CoreSimulator/Devices/234BDF8D-0D90-44ED-8FCC-2FE83E469B94/data/Containers/Bundle/Application/529738C1-0368-42EF-A8C5-57F5B8D097BF/unnamed.app/ but the resources folder are inside a folder contained in that path: include/app/resources/ and there actually live all the resources configured in commonMain/resources/
is it a bug or i’m doing something wrong ?
d
The hello world sample has an image and it is found at least for me. Can you try korge-hello-world to see if it works for you?
p
of course
it works fine đŸ€”
d
It is a bit late here already, but I can check tomorrow why is that happening. Maybe related to /sdcard or other stuff related to jailing
p
ok, np. There’s something weird, because the resource that’s not found is related to the ‘resources’ folder
 the weird part is that it works fine on the hello_world project but not in mine
i’ll push some changes i did to my project to make it look as similar as possible to the working one, please pull master
👍 1
and this is the file that’s requested to be loaded in the resources folder
if I open the project in xcode the assets are in the correct folder (dont know very much about ios development, but a folder ‘assets’ seems to be the correct one )
d
I launched it via console with gradlew runSimulatorDebug
p
And did it work?
d
well tried yesterday and it displayed a pink screen and on the terminal there was an exception of the file not being found
I plan to check again and try to figure out the issue later
p
Ok, thats the behavior i get too, not sure what's the difference between hello world and this project... Weird
👌 1
the good thing is that the behavior is consistent between machines
d
yeah, probably something easily fixable, but have to check the actual problem
I have figured out the issue
The problem is that you are accessing resourcesVfs, before calling the KorGE block
And I think that changes the folder to the right one on the iPhone
resourcesVfs uses the current working directory IIRC
that’s why the mains are something like:
suspend fun main() = Korge {
so all the initialization stuff is done
fixed in rc9, now you can use resourceVfs even when the by lazy of resourcesVfs is resolved before
p
Excellent man, trying it out
Thx!
d
had to put the sdcard folder in the resources folder to get it working on the simulator
p
Good point, in fact i dont know hiw to do it
Is there a kind of adb for ios?
d
no I mean that I copied the sdcard into the src/commonMain/resources
p
perfect, it worked!
d
👏