I cannot build my app for Android (iOS works perfectly) in a yarn monorepo project. When I run yarn run android
, I get the following error:
yarn run v1.22.0
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1210 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
> Task :react-native-navigation:compileReactNative60DebugKotlin
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/parse/ValueAnimationOptions.kt: (59, 25): The corresponding parameter in the supertype 'Any' is named 'other'. This may cause problems when calling this function with named arguments.
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 44): Unchecked cast: View to T
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 53): Unchecked cast: View to T
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (25, 91): Unchecked cast: Type! to Class<T>
> Task :react-native-navigation:compileReactNative60DebugJavaWithJavac FAILED
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
25 actionable tasks: 22 executed, 3 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* 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 12s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* 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 12s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (/Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)
at /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Command.handleAction (/Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/@react-native-community/cli/build/index.js:182:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I create a new RN app using:
npx react-native init MyApp --template react-native-template-typescript
Then, I added RNN to the app using:
yarn add react-native-navigation
This is the complete stack trace given by ./gradlew build --stacktrace
run inside the android folder (seems there is an issue with an invalid value for MonthOfYear (valid values 1 - 12), 0 given):
> Task :react-native-navigation:compileReactNative60DebugKotlin
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/parse/ValueAnimationOptions.kt: (59, 25): The corresponding parameter in the supertype 'Any' is named 'other'. This may cause problems when calling this function with named arguments.
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 44): Unchecked cast: View to T
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 53): Unchecked cast: View to T
w: /Users/federico/Documents/Repository/MyCoach/app/crossplatform/MyCoach/workspaces/mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (25, 91): Unchecked cast: Type! to Class<T>
> Task :react-native-navigation:compileReactNative60DebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:145)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:138)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
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$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:158)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:96)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:90)
at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:92)
at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:110)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:106)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:154)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:122)
at com.android.build.gradle.tasks.AndroidJavaCompile.compile(AndroidJavaCompile.kt:214)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:401)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:390)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:373)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:79)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:210)
at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:117)
... 35 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy95.list(Unknown Source)
at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.list(ClientCodeWrapper.java:232)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:648)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:526)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1120)
at jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:810)
at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:344)
at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285)
at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052)
at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:100)
at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:142)
... 118 more
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.api.internal.tasks.compile.reflect.SourcepathIgnoringInvocationHandler.invoke(SourcepathIgnoringInvocationHandler.java:64)
... 137 more
Caused by: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
at jdk.zipfs/jdk.nio.zipfs.ZipUtils.dosToJavaTime(ZipUtils.java:109)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.cen(ZipFileSystem.java:1950)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$Entry.readCEN(ZipFileSystem.java:1937)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getEntry(ZipFileSystem.java:1324)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.getFileAttributes(ZipFileSystem.java:312)
at jdk.zipfs/jdk.nio.zipfs.ZipPath.getAttributes(ZipPath.java:721)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:293)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:523)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319)
at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715)
... 140 more
* Get more help at https://help.gradle.org
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
BUILD FAILED in 1m 1s
25 actionable tasks: 22 executed, 3 up-to-date
Have you followed the documentation for installing react-native-navigation? From a fresh react-native project you can run react-native link react-native-navigation
for a autolink. The library requires some native code changes which is taken care of by that link script.
I had already run react-native link
, I run it again but the error is exactly the same...
npx react-native link react-native-navigation
info Linking "react-native-navigation" iOS dependency
info iOS module "react-native-navigation" has been successfully linked
info Linking "react-native-navigation" Android dependency
info Android module "react-native-navigation" has been successfully linked
Running android postlink script
Linking MainApplication...
MainApplication already extends NavigationApplication
NavigationReactNativeHost is already used
SOLoader.init() is not called
MainApplication linked successfully!
Linking MainActivity...
MainActivity already extends NavigationActivity
MainActivity linked successfully!
Linking root build.gradle...
Kotlin version already specified
Kotlin plugin already declared
Root build.gradle linked successfully!
Running iOS postlink script
Linking AppDelegate...
AppDelegate already linked
react-native-navigation linked successfully
@keyblade95 Hey there was a slight issue with the autolink script which is fixed by https://github.com/wix/react-native-navigation/pull/5990. Could you try this out? https://github.com/wix/react-native-navigation/issues/5983#issuecomment-593735861
I tried setting minSdkVersion
to both 19 and 21, but the same problem still occurs
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
RNNKotlinVersion = "1.3.61"
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
classpath("com.android.tools.build:gradle:3.4.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
Do you have an idea on how to solve this?
Would you be able to provide a minimal reproduction for me to have a look?
This is the mobile app of my yarn morepo. It depends on an internal shared package, but you can exclude it temporarily
Could you create a minimal reproduction? Preferrably on Github. I'm not too familiar with yarn monorepo to give you any meaningful insight.
I created a new project from scratch (I included the commands in the readme). Now the error is changed...
https://github.com/keyblade95/react-native-navigation-poc
@keyblade95 I've had a look at the repo and seems like you have not ran:
react-native link react-native-navigation
which will modify the native files required for running RNN. If you still have problems after running that you could reference the Playground
app or the boilerplate project I've setup here.
If I run npx react-native link react-native-navigation
, I get:
info iOS module "react-native-navigation" is already linked
info Android module "react-native-navigation" is already linked
Running android postlink script
Linking MainApplication...
MainApplication already extends NavigationApplication
NavigationReactNativeHost is already used
SOLoader.init() is not called
MainApplication linked successfully!
Linking MainActivity...
MainActivity already extends NavigationActivity
MainActivity linked successfully!
Linking root build.gradle...
Kotlin version already specified
Kotlin plugin already declared
Root build.gradle linked successfully!
Running iOS postlink script
Linking AppDelegate...
AppDelegate already linked
react-native-navigation linked successfully
@jinshin1013 Does yarn monorepo
generate a different project structure compared to react-native init
? This might be the reason why the link scripts reports success while you've noticed his project isn't linked 🤔
Just a thought..
@guyca yeah running link script in yarn monorepo may result in unexpected outcome as they have somewhat different folder structure. I guess it'd best to manually changes the files.
@keyblade95 Would you be able to try comparing your Android and iOS files with the Playground app or my boilerplate project I've listed above (sorry I'm on my phone so can't you the link)?
The first thing I did was to try you boilerplate project as-is... And also this failed... No yarn at all involved in the process. I only run npm install
followed by:
(base) ➜ rnn-boilerplate-master npx react-native run-android
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-navigation (to unlink run: "react-native unlink react-native-navigation")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1210 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
> Task :react-native-navigation:compileReactNative60DebugKotlin
w: /Users/federico/Downloads/rnn-boilerplate-master/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/parse/ValueAnimationOptions.kt: (59, 25): The corresponding parameter in the supertype 'Any' is named 'other'. This may cause problems when calling this function with named arguments.
w: /Users/federico/Downloads/rnn-boilerplate-master/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 44): Unchecked cast: View to T
w: /Users/federico/Downloads/rnn-boilerplate-master/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (17, 53): Unchecked cast: View to T
w: /Users/federico/Downloads/rnn-boilerplate-master/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/PropertyAnimatorCreator.kt: (25, 91): Unchecked cast: Type! to Class<T>
> Task :react-native-navigation:compileReactNative60DebugJavaWithJavac FAILED
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
21 actionable tasks: 21 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* 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 40s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative60DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* 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 40s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (/Users/federico/Downloads/rnn-boilerplate-master/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/Users/federico/Downloads/rnn-boilerplate-master/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)
at /Users/federico/Downloads/rnn-boilerplate-master/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Command.handleAction (/Users/federico/Downloads/rnn-boilerplate-master/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:182:9)
Can it depends on a wrong Android setup?
I have just upgraded from v4 to v6.3.1 of RNN and I am getting the same issue. (i followed the migration guide).
@Eldavid @keyblade95 What's the version of the gradle plugin your project is using? Try opening your project in Android Studio, if you're using an old version of gradle a dialog should popup and instruct you to upgrade.
I have v3.4.2 of gradle, referring to the docs it's the minimum requirement.
I tried this approach just yesterday and I confirm it solved the issue I reported above. I opened the android folder with Android Studio and updated gradle.
The problem now is another one:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '.../test_app/node_modules/react-native-navigation/lib/android/app/build.gradle' line: 4
* What went wrong:
A problem occurred evaluating project ':react-native-navigation'.
> Plugin with id 'kotlin-android' not found.
* 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:
A problem occurred configuring project ':react-native-navigation'.
> compileSdkVersion is not specified.
* 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.
==============================================================================
I updated the IDE and the Gradle Plugin to 3.6.1 and the Gradle to 6.3 and it works! Thank you for the advice.
@keyblade95 errors keep happening even after @Eldavid's suggestion.
I had similar issue. Try add this in your build.gradle file.
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56")|| names.contains("reactNative57")|| names.contains("reactNative57_5") || names.contains("reactNative62")) {
setIgnore(true)
}
}
}
}
}
}
@keyblade95 errors keep happening even after @Eldavid's suggestion.
Try update your files by this https://github.com/wix/react-native-navigation/issues/5904#issue-560273157
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.
This is still happening and linking does not help:
$ npx react-native link react-native-navigation --verbose
debug Available platforms: iOS, Android
warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
debug Package to link: react-native-navigation
debug Reading C:\projects\app\xxx\ios\Podfile
info Linking "react-native-navigation" iOS dependency
debug Reading C:\projects\app\xxx\ios\Podfile
error Linking "react-native-navigation" failed.
* What went wrong:
A problem occurred evaluating project ':react-native-navigation'.
> Plugin with id 'kotlin-android' not found.
@pke did you have Gradle updated?
Most helpful comment
I updated the IDE and the Gradle Plugin to 3.6.1 and the Gradle to 6.3 and it works! Thank you for the advice.