5

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-screens:compileDebugKotlin'.

Error while evaluating property 'filteredArgumentsMap' of task ':react-native-screens:compileDebugKotlin' Could not resolve all artifacts for configuration ':react-native-screens:debugCompileClasspath'. > Failed to transform core-ktx-1.5.0.aar (androidx.core:core-ktx:1.5.0) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}. > Execution failed for AarToClassTransform: C:\Users\ABC.gradle\caches\transforms-3\186e662719f643b770233b2443ab0f39\transformed\jetified-core-ktx-1.5.0.aar. > zip END header 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 28s

at makeError (D:\ReactNative\todo\node_modules\execa\index.js:174:9)
at D:\ReactNative\todo\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\ReactNative\todo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)  
at async Command.handleAction (D:\ReactNative\todo\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details. please help me out with this

Azhan Hussain
  • 51
  • 1
  • 2

2 Answers2

7

Found the correct solution here. This worked for me. https://github.com/software-mansion/react-native-screens/issues/1369#issuecomment-1105152720:

In my android/build.gradle file i change this:

buildscript {
    ext {
        // ...
        kotlin_version = '1.6.10' // <- add this line
    }

    dependencies {
        // ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // <- add this line
        // ...
    }
}

and I also add increased the memory in android/gradle.properties: org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m

smitop
  • 4,770
  • 2
  • 20
  • 53
0

I had faced same issue last week but no solution found online. I'd created new project and copied the App.js, other JS files (contain development code) of the old project to new project folder. In this way I resolved this issue.

Javed
  • 1
  • 1