react-native-gradle-plugin:compileKotlin FAILED - android

I upgraded react native vrsion from 0.64.1 to latest. And when try to run
cd .\android\ && ./gradlew clean
I'm getting the following error,
> Task :react-native-gradle-plugin:compileKotlin FAILED
Caching disabled for task ':react-native-gradle-plugin:compileKotlin' because:
Build cache is disabled
Task ':react-native-gradle-plugin:compileKotlin' is not up-to-date because:
Task has failed previously.
The input changes require a full rebuild for incremental task ':react-native-gradle-plugin:compileKotlin'.
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
Using Kotlin/JVM incremental compilation
[KOTLIN] Kotlin compilation 'jdkHome' argument: C:\Program Files\Java\jdk-11.0.14
i: found daemon on port 17773 (1316337 ms old), trying to connect
i: connected to the daemon
Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0], reportSeverity=2, requestedCompilationResults=[0]kotlinScriptExtensions=[kt, kts, java]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, classpathChanges=org.jetbrains.kotlin.incremental.ClasspathChanges$NotAvailable$ClasspathSnapshotIsDisabled#34aad1e, workingDir=C:\Users\Chanduka\Desktop\hutch\src\smart-app\node_modules\react-native-gradle-plugin\build\kotlin\compileKotlin, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=C:\Users\Chanduka\Desktop\hutch\src\smart-app\node_modules\react-native-gradle-plugin\build\kotlin\compileKotlin\build-history.bin, useModuleDetection=false), usePreciseJavaTracking=trueoutputFiles=[C:\Users\Chanduka\Desktop\hutch\src\smart-app\node_modules\react-native-gradle-plugin\build\classes\kotlin\main, C:\Users\Chanduka\Desktop\hutch\src\smart-app\node_modules\react-native-gradle-plugin\build\kotlin\compileKotlin])
my java version is 11

Related

Cannot build RN App after integrating Sentry

OS:
MacOS
Platform:
Android
SDK:
#sentry/react-native (2.0.0)
react-native version: 0.61.4
Are you using Expo?
No
Are you using sentry.io or on-premise?
sentry.io (SaaS)
I have following issue:
When I try to to build the project by this command
npx react-native run-android
It fires this error
Task :sentry_react-native:compileDebugJavaWithJavac FAILED
570 actionable tasks: 3 executed, 567 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sentry_react-native:compileDebugJavaWithJavac'.
> java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
Expected result:
The project should be built without issue
Have you tried first doing
yarn add jetifier and then npx jetify
Then building your app.
Try this and do let me know in case of any concerns.
It worked when I switched
#sentry/react-native to version "^1.3.8"
looks it was a conflict with Gradle version

React Native: Task :app:installDebug FAILED

I am working on MAC, trying to run React Native on android but it throws this error: Task :app:installDebug FAILED. This is the full error:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 2 executed, 25 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:installDebug'.
> File '/Users/vinaysharma/Library/Android/sdk/platform-tools/adb' specified for property 'adbExe' does not exist.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8088
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:installDebug'.
> File '/Users/vinaysharma/Library/Android/sdk/platform-tools/adb' specified for property 'adbExe' does not exist.
I've tried reinstalling Android Studio twice as well as creating a new project for RN but that didn't help me out.
I tried this as well: brew cask install android-platform-tools. Thanks.
You need to install adbExe. Please follow steps in this link

Google Cloud End Point Error: Process exited before success message

I am facing this error when I run the appengineStart task.
print of the error
The error says: “com.google.cloud.tools.appengine.cloudsdk.internal.process.ProcessRunnerException: Process exited before success message”
I searched on Google, but wasn’t able to find a solution.
Here is the full error log:
10:33:08: Executing task 'appengineStart'...
Executing tasks: [appengineStart]
Configuration on demand is an incubating feature.
Gradle now uses separate output directories for each JVM language, but this
build assumes a single directory for all classes from a source set. This
behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
:backend:compileJava UP-TO-DATE
:backend:processResources NO-SOURCE
:backend:classes UP-TO-DATE
:backend:endpointsDiscoveryDocs UP-TO-DATE
:backend:_zipDiscoveryDocs UP-TO-DATE
:backend:war UP-TO-DATE
:backend:explodeWar UP-TO-DATE
:backend:assemble UP-TO-DATE
:backend:appengineStart
Warning: Google App Engine Java 7 runtime is deprecated.
Warning: See https://cloud.google.com/appengine/docs/deprecations/java7
ago 23, 2018 10:33:24 AM java.util.prefs.WindowsPreferences <init>
ADVERT?NCIA: Could not open/create prefs root node Software\JavaSoft\Prefs
at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
ago 23, 2018 10:33:25 AM
com.google.appengine.tools.development.SystemPropertiesManager
setSystemProperties
INFORMA??ES: Overwriting system property key
'java.util.logging.config.file', value
'C:\Users\igor\AppData\Local\Google\Cloud SDK\google-cloud- `sdk\platform\google_appengine\google\appengine\tools\java\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'C:\Users\igor\ud-exercises\ud867\FinalProject\backend\build\exploded-backend\WEB-INF\appengine-web.xml'`
************************************************
Could not open the requested socket: Address already in use: bind
Try overriding --address and/or --port.
Exception in thread "wait-for-process-exit-and-output-handlers" com.google.cloud.tools.appengine.api.AppEngineException: Non zero exit: 2
at com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitListener.onExit(NonZeroExceptionExitListener.java:30)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.syncRun(DefaultProcessRunner.java:211)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner.access$200(DefaultProcessRunner.java:38)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcessRunner$3.run(DefaultProcessRunner.java:223)
:backend:appengineStart FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backend:appengineStart'.
>
com.google.cloud.tools.appengine.cloudsdk.internal.process.ProcessRunnerException: Process exited before success message
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
6 actionable tasks: 1 executed, 5 up-to-date
10:33:26: Task execution finished 'appengineStart'.
Could not open the requested socket: Address already in use: bind indicates that you either previously started a dev server and it didn't exit properly, or you have another process using the same port. You need to kill the offending process (or restart your computer, which has the same effect) or change the port on which your dev server runs. Essentially, add the following to your gradle file, changing the port as necessary:
appengine.run.port = 8888

Jenkins CI Android Gradle Build Fail

I have use jenkins with docker
after pull and install the following plugin
Git Plugin
Gradle Plugin
Android Lint Plugin
Google Play Android Publisher Plugin
THEN setup JDK, Repository (GitLab)
AND create project and run, it's show the following error.
RUN COMMAND
docker run -p 8080:8080 -v /Users/abc/Library/Android/sdk:/var/android_home -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
JENKINS CONSOLE OUTPUT
Building in workspace /var/jenkins_home/workspace/ABC Project
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://office.viinsoft.com/issoft/mappening-android.git # timeout=10
Fetching upstream changes from http://office.viinsoft.com/issoft/mappening-android.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress http://office.viinsoft.com/issoft/mappening-android.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 7a760b63852e92c57e5b4dea5bdf6680b01d8894 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 7a760b63852e92c57e5b4dea5bdf6680b01d8894
Commit message: "Test Jenkins#2"
> git rev-list --no-walk 7a760b63852e92c57e5b4dea5bdf6680b01d8894 # timeout=10
[Gradle] - Launching build.
[Mappening Project] $ "/var/jenkins_home/workspace/Mappening Project/gradlew" assembleDebug
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'testCompile' in project ':app' is deprecated. Use 'testImplementation' instead.
Configuration 'androidTestCompile' in project ':app' is deprecated. Use 'androidTestImplementation' instead.
:app:preBuild UP-TO-DATE
:app:preDevDebugBuild UP-TO-DATE
:app:compileDevDebugAidl UP-TO-DATE
:app:compileDevDebugRenderscript UP-TO-DATE
:app:checkDevDebugManifest UP-TO-DATE
:app:generateDevDebugBuildConfig UP-TO-DATE
:app:generateDevDebugResValues UP-TO-DATE
:app:generateDevDebugResources UP-TO-DATE
:app:mergeDevDebugResourcesAAPT err(Facade for 849578689): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
AAPT err(Facade for 1702555035): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 1702555035 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
AAPT err(Facade for 1365735589): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 1365735589 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
AAPT err(Facade for 212997924): /var/android_home/build-tools/26.0.2/aapt2: 6: /var/android_home/build-tools/26.0.2/aapt2: Syntax error: Unterminated quoted string
Slave 212997924 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
Slave 849578689 failed to start
java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at /var/android_home/build-tools/26.0.2/aapt2) are not corrupted.
at com.android.builder.png.AaptProcess.waitForReadyOrFail(AaptProcess.java:211)
at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
at java.lang.Thread.run(Thread.java:748)
Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
:app:mergeDevDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDevDebugResources'.
> Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
7 actionable tasks: 1 executed, 6 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
TRAIL AND STILL ERROR
I was google around it seem that, a solution need to use older build-tool which I don't want Android studio 2.1.2 gradle aapt Syntax error: Unterminated quoted string
and someone said I have missing library to execute 64 bit code, so I run the following command on my mac OSX and check, but it seem okay Android Studio 3.0 - No server to serve request
otool -L build-tools/26.0.2/aapt2
build-tools/26.0.2/aapt2:
#rpath/libc++.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
finally, I give permission to my local path sudo chmod 755 -R /Users/sattha.p/Library/Android/sdk but nothing change even restart docker.

Android gradle build fails suddenly on ':app:mergeDebugResources' with no error messages

My gradle build stopped working completely out of the blue. Minute earlier it worked fine. Didn't change anything in gradle config files; as a matter of fact I was only changing application style in XML.
Make, clean and run produce:
Execution failed for task ':app:mergeDebugResources'.
> -1
Running gradle with --stacktrace produces:
Executing task ':app:mergeDebugResources' (up-to-date check took 0.031 secs) due to:
Task ':app:mergeDebugResources' class path has changed from 35ff0c585719dc5a2e2e4d58900e722a to 01ad85243d44a7018a6f6b671ff7bf6b.
All input files are considered out-of-date for incremental task ':app:mergeDebugResources'.
Unable do incremental execution: full task run :app:mergeDebugResources FAILED :app:mergeDebugResources
(Thread[Task worker for ':',5,main]) completed.
Took 0.155 secs.
Removing build directory didn't help, as well as cache invalidation and restart. Any ideas?
Using Canary (3.0) with build tools version 26.0.0.
Update #1
Running with --info --debug hints:
could not find method google() for arguments [] on repository container.
However, removing google() from config yields:
Received result
Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project '[project name]'.] from daemon DaemonInfo{pid=3686, address=[e01105f7-0954-4e44-b561-3ac18fc3194f port:35854, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1499443736429, context=DefaultDaemonContext[uid=64f95479-4418-4e3d-948b-7481648b65df,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/iwoherka/.gradle/daemon,pid=3686,idleTimeout=10800000,daemonOpts=-Xmx1536m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
18:09:26.648 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished
18:09:26.649 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop
Well, it turned out that the problem was fonts in res directory instead of main which caused gradle to act very weird.

Categories

Resources