NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
518 stars 136 forks source link

feat: gradle 8, kotlin 2.0 #1812

Closed triniwiz closed 1 week ago

triniwiz commented 2 months ago

Adds the following

ammarahm-ed commented 2 months ago

Hey @triniwiz, we need this too in app/build.gradle before tasks.configureEach

rootProject.subprojects.forEach {
  it.tasks.configureEach({ DefaultTask currentTask ->
    if (currentTask =~ /.+bundleLibCompileToJar.*/) {
      cleanupAllJars.dependsOn currentTask
    }
  })
}

This fixes this error with adding open-native since it adds subprojects alongside :app subproject.

Gradle detected a problem with the following location: '/Volumes/DataDrive/Projects/nativescript/open-native/packages/core/react-android/react/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar'.

    Reason: Task ':app:cleanupAllJars' uses this output of task ':react:bundleLibCompileToJarDebug' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':react:bundleLibCompileToJarDebug' as an input of ':app:cleanupAllJars'.
      2. Declare an explicit dependency on ':react:bundleLibCompileToJarDebug' from ':app:cleanupAllJars' using Task#dependsOn.
      3. Declare an explicit dependency on ':react:bundleLibCompileToJarDebug' from ':app:cleanupAllJars' using Task#mustRunAfter.

    For more information, please refer to https://docs.gradle.org/8.4/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.