Deploying KotlinJs React web app to Heroku, error extracting tar content of undefined failed - gradle

I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get the following error
> Task :common:root:jsPackageJson
> Task :web-app:packageJson
> Task :web-app:testPackageJson
> Task :rootPackageJson
> Task :kotlinNpmInstall
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/LICENSE'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/data/features/getcomputedstyle.js'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall FAILED
> Task :kotlinNpmInstall FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':firebase-kotlin-sdk:kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 5m 20s
18 actionable tasks: 18 executed
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
Tried running kotlinNpmInstall locally on both the library and the whole project and it works properly, with no failures.

While I do not know the exact cause, it seems that multiple yarn process are spawned that corrupt each other's packages.
This can be solved with the mutex option.
To add yarn options to a kotlin/js project you can add a .yarnrc file to the root of your project.
My .yarnrc's content:
--install.mutex network
This makes yarn use a predefined port on the network for its mutex.

Related

Execution failed for task ':app:processDebugResources'.1

I clearly have no clue why it shows this error. All solutions are appreciated.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
Output: W/ziparchive( 9548): Unable to open 'C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar': No such file or directory
error: failed to open APK: I/O error.
Command: C:\Users\admin.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c8dfbdcc79a1dd8c0cb75349d60f6c77\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar\
--manifest\
C:\Users\gaurav\tutorial\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\gaurav\tutorial\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#C:\Users\gaurav\tutorial\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\gaurav\tutorial\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.tutorial\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 22s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/androidx-migration for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
Update you sdk version to 28. Edit the file build.gradle and change property compileSdkVersion up to 28.

Getting started on Corda on Windows

I am trying to get started on Corda on Windows and I am following the started guides using the following docs:
https://docs.corda.net/quickstart-index.html#setting-up-a-development-environment
https://vimeo.com/217462250
https://docs.corda.net/getting-set-up.html
I have downloaded all the latest version (as of 22.09.19) of Git (2.23.0, 64-bit version) / Java JDK (jdk-8u221-windows-x64.exe) / and the latest IntelliJ.
However I am facing the following issues:
When I open the 'Event Log' I don't see any messages event gradle message
Also when I try and run the Nodes from Intellj > Run CordaApps Kotlin I get the following error message:
When I try and run the nodes from the Git bash terminal
Jatin#LAPTOP-16QRBJDJ MINGW64 ~/cordapp-tutorial (release-V3)
$ ./gradlew.bat deployNodes
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
:java-source:compileJava UP-TO-DATE
:java-source:processResources UP-TO-DATE
:java-source:classes UP-TO-DATE
:java-source:configureCordappFatJar
:java-source:jar UP-TO-DATE
:java-source:deployNodes
Bootstrapping local network in C:\Users\Jatin\cordapp-tutorial\java-source\build\nodes
Node config files found in the root directory - generating node directories
Generating directory for Notary
Generating directory for PartyA
Generating directory for PartyB
Generating directory for PartyC
Nodes found in the following sub-directories: [Notary, PartyA, PartyB, PartyC]
Waiting for all nodes to generate their node-info files...
:java-source:deployNodes FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':java-source:deployNodes'.
> Node in Notary exited with 1 when generating its node-info - see logs in C:\Users\Jatin\cordapp-tutorial\java-source\build\nodes\Notary\logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 23s
5 actionable tasks: 2 executed, 3 up-to-date
The log:
CAPSULE EXCEPTION: Illegal char <"> at index 34: C:\Program Files\Java\jdk1.7.0\bin" (for stack trace, run with -Dcapsule.log=verbose)
USAGE: <options> corda.jar
Actions:
capsule.version - Prints the capsule and application versions.
capsule.modes - Prints all available capsule modes.
capsule.jvms - Prints a list of all JVM installations found.
capsule.help - Prints this help message.
Options:
capsule.mode=<value> - Picks the capsule mode to run.
capsule.reset - Resets the capsule cache before launching. The capsule to be re-extracted (if applicable), and other possibly cached files will `enter code here`be recreated.
capsule.log=<value> (default: quiet) - Picks a log level. Must be one of none, quiet, verbose, or debug.
capsule.java.home=<value> - Sets the location of the Java home (JVM installation directory) to use; If 'current' forces the use of the JVM that launched the capsule.
capsule.java.cmd=<value> - Sets the path to the Java executable to use.
capsule.jvm.args=<value> - Sets additional JVM arguments to use when running the application."
Have you set Java classpath to point to jdk1.8.0_221?
From the log record it seems that the jdk is 1.7. Corda require at least version 8u171. Please check the classpath and installed java version.
You should add Java to the PATH environment variable by following the instructions in the Oracle documentation - "https://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html#path"
Which java variant you are using?
If it is Adopt OpenJDK 8, use HotSpot JVM not the OpenJ9 Version.
Here is the link for windows x64 AdoptOpenJDK 8

How to fix a diagnostic error in flutter?

When I run the application gradle is failing to build
Compiler message:
file:///C:/Users/Wellick/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sticky_header-0.3.4/lib/src/widgets/sticky_header_layout_builder.dart:147:16:
Error: The argument type 'String' can't be assigned to the parameter
type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart'
('file:///C:/Users/Wellick/Documents/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to
'DiagnosticsNode'.
context: context);
^ Compiler failed on C:\Users\Wellick\Desktop\flutter\rapidinho-master\lib\main.dart
FAILURE: Build failed with an exception.
Where: Script 'C:\Users\Wellick\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle'
line: 665
What went wrong: Execution failed for task ':app:compileflutterBuildDebugArm'.
Process 'command 'C:\Users\Wellick\Documents\flutter\bin\flutter.bat'' finished with
non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 24s Finished with error: Gradle task assembleDebug
failed with exit code 1
It seems that this issue was due to the previous version 0.3.4 to be exact, the issue was reported in GitHub and the fix is to upgrade the version to 0.4.0. Currently, the latest version 0.5.0 is more stable than the previous versions.

NativeScript UI Autocomplete don't compiled

In my nativescript app, I have a problem about using nativescript ui autocomplete. I compile my mobile application to android apps. It has an error as below
<======-------> 50% CONFIGURING [3s]
<====---------> 35% EXECUTING [13s]
<======-------> 51% EXECUTING [20s]
Exception in thread "main" java.lang.ClassNotFoundException: Class: com.telerik.widget.autocomplete.ShowSuggestionListListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:776)
at org.nativescript.staticbindinggenerator.Generator.collectInterfaceMethods(Generator.java:703)
at org.nativescript.staticbindinggenerator.Generator.getPublicApi(Generator.java:227)und 0 errors. Watching for file changes.
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:342)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:133)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:172)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:90)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:66)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:runSbg'.
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 25s
10:34:24 - Found 0 errors. Watching for file changes.
Unable to apply changes on device: 192.168.80.101:5555. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-webpack.js
Stopping webpack watch
delete node_modules, platforms, hooks folders and package-lock.json file
run
npm i
rebuild the project ->
tns run android
or
tns build android

How to run the Kotlin/Native win32 sample

I'm trying to run Kotlin/Native v0.3 win32 sample by following the blog at https://blog.jetbrains.com/kotlin/2017/06/kotlinnative-v0-3-is-out/
I downloaded the x86-64 Windows zip file as instructed at the end of the blog.
I run kotlin-native-windows-0.3\samples>gradlew.bat and it
downloaded something and said 'BUILD SUCCESSFUL'. (I'm not sure if
this step is necessary)
2.1 But If I run kotlin-native-windows-0.3\samples>gradlew build
in this folder, I got some failures:
C:\Users\OO\Documents\kotlin-native-windows-0.3\samples>gradlew build
:concurrent:assemble UP-TO-DATE
:concurrent:check UP-TO-DATE
:concurrent:downloadKonanCompiler
:concurrent:genMessageChannelInteropStubs UP-TO-DATE
:concurrent:compileCpp FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':concurrent:compileCpp'.
A problem occurred starting process 'command './buildCpp.sh''
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Then I run kotlin-native-windows-0.3\samples\win32>build.bat and I
got another error.
C:\Users\OO\Documents\kotlin-native-windows-0.3\samples\win32>build.bat
exception: java.lang.IllegalStateException: Could not find "win32" in [C:\Users\OO\Documents\kotlin-native-windows-0.3\samples\win32, C:\Users\OO\.konan\klib, C:\Users\OO\DOCUME~1\KOTLIN~1.3\bin\..\klib].
at org.jetbrains.kotlin.backend.konan.library.KonanLibrarySearchPathResolver.resolve(SearchPathResolver.kt:71)
at org.jetbrains.kotlin.backend.konan.KonanConfig$librariesFound$2.invoke(KonanConfig.kt:70)
at org.jetbrains.kotlin.backend.konan.KonanConfig$librariesFound$2.invoke(KonanConfig.kt:34)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.backend.konan.KonanConfig.getLibrariesFound(KonanConfig.kt)
at org.jetbrains.kotlin.backend.konan.KonanConfig.access$getLibrariesFound$p(KonanConfig.kt:34)
at org.jetbrains.kotlin.backend.konan.KonanConfig$libraries$2.invoke(KonanConfig.kt:77)
at org.jetbrains.kotlin.backend.konan.KonanConfig$libraries$2.invoke(KonanConfig.kt:34)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.backend.konan.KonanConfig.getLibraries$backend_native_compiler(KonanConfig.kt)
at org.jetbrains.kotlin.backend.konan.KonanConfig.loadLibMetadata(KonanConfig.kt:90)
at org.jetbrains.kotlin.backend.konan.KonanConfig.<init>(KonanConfig.kt:80)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:66)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:56)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:93)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:46)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:90)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:68)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:34)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:160)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:151)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:169)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:166)
at org.jetbrains.kotlin.backend.konan.util.UtilKt.profileIf(util.kt:33)
at org.jetbrains.kotlin.backend.konan.util.UtilKt.profile(util.kt:28)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:168)
at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:174)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:46)
I'm very new to Kotlin or Gradle world, I don't know if this is the way to compile the samples.
What additional packages should I install?
It can be easily solved by canceled the comments "rem call ..." in "build.bat"

Resources