The package i have installed does not work. (https://www.npmjs.com/package/rn-sunmi-inner-printer) - react-native

I am having build issue after installing this package:
https://www.npmjs.com/package/rn-sunmi-inner-printer
Anybody know why does the java stops at line 442?
Why does the compilation failed?
> info Running jetifier to migrate libraries to AndroidX. You can
> disable it using "--no-jetifier" flag. Jetifier found 978 file(s) to
> forward-jetify. Using 4 workers... info Starting JS server... info
> Installing the app...
>
> > Configure project :rn-sunmi-inner-printer WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and
> 'api'. It will be removed soon. For more information see:
> http://d.android.com/r/tools/update-dependency-configurations.html
>
> > Task :rn-sunmi-inner-printer:compileDebugAidl
>
> > Task :rn-sunmi-inner-printer:compileDebugJavaWithJavac FAILED
>
> 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.2/userguide/command_line_interface.html#sec:command_line_warnings
> 16 actionable tasks: 11 executed, 5 up-to-date aidl.exe E 07-17
> 09:57:43 2252 6336 aidl.cpp:581] refusing to generate code from aidl
> file defining parcelable
>
> C:\Users\User\Documents\Me\codes\AwesomeProject100\node_modules\rn-sunmi-inner-printer\android\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\woyou\aidlservice\jiuiv5\IWoyouService.java:441:
> error: reached end of file while parsing case TRANSACTION_getForce
> ^ C:\Users\User\Documents\Me\codes\AwesomeProject100\node_modules\rn-sunmi-inner-printer\android\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\woyou\aidlservice\jiuiv5\IWoyouService.java:442:
> error: reached end of file while parsing 2 errors
>
> FAILURE: Build failed with an exception.
>
> * What went wrong: Execution failed for task ':rn-sunmi-inner-printer:compileDebugJavaWithJavac'.
> > Compilation failed; see the compiler error output for details.
>
> * 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 1m 0s

Related

Getting error while creating codegen artifacts from schema

BUILD FAILED in 14s
6 actionable tasks: 6 executed
(base) abc#ABCs-MacBook-Pro android %
./gradlew generateCodegenArtifactsFromSchema
Task :app-modules:generateCodegenSchemaFromJavaScript FAILED
/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:3689
throw error;
^
SyntaxError: Unexpected token (10:3)
at instantiate (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:72:32)
at constructor (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:367:12)
at TypeScriptParserMixin.raise (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:3684:19)
at TypeScriptParserMixin.unexpected (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:3723:16)
at TypeScriptParserMixin.tsParseNonArrayType (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9380:16)
at TypeScriptParserMixin.tsParseArrayTypeOrHigher (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9384:21)
at /Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9453:158
at TypeScriptParserMixin.tsInAllowConditionalTypesContext (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9809:14)
at TypeScriptParserMixin.tsParseTypeOperatorOrHigher (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9453:114)
at TypeScriptParserMixin.tsParseUnionOrIntersectionType (/Users/abc/JSI-sample-project/SampleApp/node_modules/#babel/parser/lib/index.js:9462:18) {
code: 'BABEL_PARSER_SYNTAX_ERROR',
reasonCode: 'UnexpectedToken',
loc: Position { line: 10, column: 3, index: 303 },
pos: [Getter/Setter]
}
Node.js v18.9.0
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app-modules:generateCodegenSchemaFromJavaScript'.
> Process 'command 'node'' 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 4s
6 actionable tasks: 1 executed, 5 up-to-date

How to execute Gradle tests using Kotlin when getting the 'Please add kotlin-script-runtime.jar to the module dependencies' error?

These are the logs of the error:
./gradlew :clean :cleanTest :test -Ddebug=true -PenvironmentName=PROD --tests="*dummytest"
> Task :compileKotlin FAILED
e: /home/gpligoropoulos/xm/research_portal/rp_api_automation/src/main/kotlin/Person.kts: (1, 1): No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details
* 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
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.7.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
3 actionable tasks: 2 executed, 1 up-to-date
The solution is to simply add a single line in dependencies the kotlin script runtime
Similar to here:
dependencies {
...
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-script-runtime
compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-runtime', version: '1.4.10'
...
}

Why when I want to run an Android yarn error like this?

Why when I want to run an Android yarn error like this?
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :app:processDebugResources FAILED
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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 2 executed, 8 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher (aka com.konspirasisnack:mipmap/ic_launcher) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tring/app_name (aka com.konspirasisnack:string/app_name) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource m
ipmap/ic_launcher_round (aka com.konspirasisnack:mipmap/ic_launcher_round) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:6:5-25:19: AAPT: error: resource s
tyle/AppTheme (aka com.konspirasisnack:style/AppTheme) not found.
D:\xampp\htdocs\konspirasiSnack\android\app\src\main\AndroidManifest.xml:13:7-23:18: AAPT: error: resource
string/app_name (aka com.konspirasisnack:string/app_name) not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. R
un with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 35s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnat
ive.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
react native versi 0.62.2
distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip
os windows 10
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
ANDROID_HOME = C:\Users\user\AppData\Local\Android\Sdk
JAVA_HOME = C:\Program Files\Java\jdk

Exception when building a kotlin/js project: error package.json: Name contains illegal characters

Trying to build the a kotlin/js project and getting the following exception:
error package.json: Name contains illegal characters
The project is here:
https://github.com/darran-kelinske-fivestars/cordova-alternative-pattern/tree/kotlin_multiplatform/js
Full output:
3:05:37 PM: Executing task 'build'...
Executing tasks: [build] in project /rom/source/fivestars/CordovaAlternativePattern/js
> Configure project :SharedCode
Kotlin Multiplatform Projects are an experimental feature.
> Task :SharedCode:jsPackageJson
> Task :js:packageJson
> Task :js:testPackageJson
> Task :kotlinNodeJsSetup SKIPPED
> Task :kotlinNpmInstall FAILED
error package.json: Name contains illegal characters
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.21.1
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 885ms
4 actionable tasks: 4 executed
3:05:38 PM: Task execution finished 'build'.
The issue was with my rootProject.name definition in settings.gradle
I had to change
rootProject.name='Cordova Alternative Pattern'
to
rootProject.name='CordovaAlternativePattern'

React Native: error getting Invalid filename. Unable to add

I am very new to react-native and getting error while generating build for android.
npm version - 5.6.0
react-native - 2.0.1
node - v8.11.3
cd android && ./gradlew assembleRelease && cd ..
> :app:generateReleaseBuildConfig UP-TO-DATE :app:mergeReleaseShaders
> UP-TO-DATE :app:compileReleaseShaders UP-TO-DATE
> :app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets
> UP-TO-DATE :app:generateReleaseResValues :app:generateReleaseResources
> :app:mergeReleaseResources :app:recordFilesBeforeBundleCommandRelease
> :app:bundleReleaseJsAndAssets UP-TO-DATE
> :app:generateBundledResourcesHashRelease
> a80585d59325c208e3d120fe613639e73132576ef0e4e85a5de149e5d64c9e16
> :app:processReleaseManifest UP-TO-DATE :app:processReleaseResources
> /Users/ravindrayadav/Documents/ZupplerMobile/mayaflavorsofindia/android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_zupplernative_node_modules_reactnativegoogleplacesautocomplete_images_powered_by_google_on_white.png:
> error: Invalid filename. Unable to add.
>
> :app:processReleaseResources FAILED
>
> FAILURE: Build failed with an exception.
>
> * What went wrong: Execution failed for task ':app:processReleaseResources'.
> > com.android.ide.common.process.ProcessException: Failed to execute aapt
>
> * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>
> BUILD FAILED
>
> Total time: 11.171 secs
delete image files in android/app/src/main/res/drawable-* directory and rebuild it