Open soywiz opened 3 weeks ago
As I see you've already created the issue from the discusstion, thanks for that :)
For this problem. Could you try to comment or remove these lines: https://github.com/AShynkevich/korge-test/blob/master/gradle.properties#L6-L7 Also try to set https://github.com/AShynkevich/korge-test/blob/master/gradle/libs.versions.toml#L2 to korge = { id = "com.soywiz.korge", version = "6.0.0-beta2" }
I did it (push it) and have another error after build:
./gradlew clean build
* What went wrong:
Execution failed for task ':processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource mipmap/icon (aka com.sample.demo:mipmap/icon) not found.
ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource style/AppThemeOverride (aka com.sample.demo:style/AppThemeOverride) not found.
ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_banner (aka com.sample.demo:drawable/app_banner) not found.
ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_icon (aka com.sample.demo:drawable/app_icon) not found.
This is right direction and we need anything else. Any ideas?
As I see you've already created the issue from the discusstion, thanks for that :)
For this problem. Could you try to comment or remove these lines: https://github.com/AShynkevich/korge-test/blob/master/gradle.properties#L6-L7 Also try to set https://github.com/AShynkevich/korge-test/blob/master/gradle/libs.versions.toml#L2 to korge = { id = "com.soywiz.korge", version = "6.0.0-beta2" }
I did it (push it) and have another error after build:
./gradlew clean build
* What went wrong: Execution failed for task ':processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction > Android resource linking failed ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource mipmap/icon (aka com.sample.demo:mipmap/icon) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource style/AppThemeOverride (aka com.sample.demo:style/AppThemeOverride) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_banner (aka com.sample.demo:drawable/app_banner) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_icon (aka com.sample.demo:drawable/app_icon) not found.
This is right direction and we need anything else. Any ideas?
Can you try (instead of build), ./gradlew runJvmAutoreload
?
As I see you've already created the issue from the discusstion, thanks for that :)
For this problem. Could you try to comment or remove these lines: https://github.com/AShynkevich/korge-test/blob/master/gradle.properties#L6-L7 Also try to set https://github.com/AShynkevich/korge-test/blob/master/gradle/libs.versions.toml#L2 to korge = { id = "com.soywiz.korge", version = "6.0.0-beta2" }
I did it (push it) and have another error after build:
./gradlew clean build
* What went wrong: Execution failed for task ':processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction > Android resource linking failed ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource mipmap/icon (aka com.sample.demo:mipmap/icon) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:7:2-31:16: AAPT: error: resource style/AppThemeOverride (aka com.sample.demo:style/AppThemeOverride) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_banner (aka com.sample.demo:drawable/app_banner) not found. ERROR: /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml:17:3-30:14: AAPT: error: resource drawable/app_icon (aka com.sample.demo:drawable/app_icon) not found.
This is right direction and we need anything else. Any ideas?
Can you try (instead of build),
./gradlew runJvmAutoreload
?
Done! The command run desktop app:
What should I do If I need to build jar/apk bundle or run android version?
PS: I tried to run ./gradlew compileReleaseKotlinAndroid
but had the error above
Can you put here the generated /Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml
file?
Can you put here the generated
/Users/user_name/KorgeProjects/test-korge/build/AndroidManifest.xml
file?
Sure
@soywiz, is anything else needed from my side?
Does this tasks work for you?
./gradlew runAndroidDebug
./gradlew runAndroidEmulatorDebug
./gradlew runAndroidDeviceDebug
Also if you call ./gradlew compileReleaseKotlinAndroid
twice, the error reproduces?
I belive it compileReleaseKotlinAndroid
have some files generated after when required, while run* variants works as expected. build
was not tested directly, because it was so slow on e2e tests (including all kotlin native targets) that it is not supported directly. Only tasks for specific targets are supported.
Tasks in the groups install
, run
and package
are supported (and at least jvmTest
in the verification group). The other are intermediates that might not be tested.
For android these are the tasks:
Does this tasks work for you?
./gradlew runAndroidDebug ./gradlew runAndroidEmulatorDebug ./gradlew runAndroidDeviceDebug
Yes, it works for me - thanks! Also I tried the command:
./gradlew installAndroidRelease
It built successfully, but there are many warnings which I can't fix in the project:
Please remove 'concurrentMain' and include its sources to one of the default source set: https://kotl.in/hierarchy-template
For example:
kotlin.sourceSets.commonMain.kotlin.srcDir() // <-- pass here sources directory
Or add explicit dependency if the solution above is not applicable:
kotlin.sourceSets["concurrentMain"].dependsOn(commonMain)
See https://kotl.in/connecting-source-sets for more details.
w: Kotlin Source Set 'concurrentTest' is included in compilations of Kotlin Targets: 'jvm', 'iosArm64', 'iosSimulatorArm64'
but it doesn't depend on 'commonTest'
Please remove 'concurrentTest' and include its sources to one of the default source set: https://kotl.in/hierarchy-template
For example:
kotlin.sourceSets.commonMain.kotlin.srcDir() // <-- pass here sources directory
Or add explicit dependency if the solution above is not applicable:
kotlin.sourceSets["concurrentTest"].dependsOn(commonTest)
See https://kotl.in/connecting-source-sets for more details.
> Task :deps:processReleaseManifest
/Users/user_name/KorgeProjects/test-korge/deps/build/AndroidManifest.xml:3:5-74 Warning:
uses-sdk:minSdkVersion value (18) specified in the manifest file is ignored. It is overridden by the value declared in the DSL or the variant API, or 1 if not declared/present. Current value is (1).
/Users/user_name/KorgeProjects/test-korge/deps/build/AndroidManifest.xml:3:5-74 Warning:
uses-sdk:targetSdkVersion value (30) specified in the manifest file is ignored. It is overridden by the value declared in the DSL or the variant API, or 1 if not declared/present. Current value is (1).
Looks like the fix is possible inside the gradle plugin
Also if you call
./gradlew compileReleaseKotlinAndroid
twice, the error reproduces?I belive it
compileReleaseKotlinAndroid
have some files generated after when required, while run* variants works as >expected.build
was not tested directly, because it was so slow on e2e tests (including all kotlin native targets) that it is > not supported directly. Only tasks for specific targets are supported.
Unfortunately, reproduces :(
Glad to know that the first commands work for you.
I have done some fixes and improvements in the main branch. For now, use the tasks from the documentation.
Sounds awesome! thank you so much ^_^
Discussed in https://github.com/korlibs/korge/discussions/2280