# npx instrumentdynatrace gradle=android/build.gradle.kts fails

**URL:** <https://community.dynatrace.com/t/npx-instrumentdynatrace-gradle-android-build-gradle-kts-fails/55547>\
**Category:** Real User Monitoring\
**Tags:** android, mobile-monitoring, gradle\
**Created:** [April 14, 2026, 12:18am UTC](https://community.dynatrace.com/t/npx-instrumentdynatrace-gradle-android-build-gradle-kts-fails/55547 "2026-04-14T00:18:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aman-Shaikh](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Aman-Shaikh](https://community.dynatrace.com/u/Aman-Shaikh)\
**Post date:** [April 14, 2026, 12:18am UTC](https://community.dynatrace.com/t/npx-instrumentdynatrace-gradle-android-build-gradle-kts-fails/55547/1 "2026-04-14T00:18:40Z")

</div>

Hello there,

I have react native app with android folder having build.gradle.kts when I do&nbsp;npx instrumentdynatrace gradle=android/build.gradle.kts it fails to set up android side of the project and give error .gradle file not found even though it is there.

![AmanShaikh_0-1776125887479.png](https://global.discourse-cdn.com/dynatrace/optimized/2X/a/a17347aacd70eb5cf0048ceba84b878808ac2a5b_2_690x42.png)

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [April 14, 2026, 10:37am UTC](https://community.dynatrace.com/t/npx-instrumentdynatrace-gradle-android-build-gradle-kts-fails/55547/2 "2026-04-14T10:37:51Z")

</div>

Hi,&nbsp;  
build.gradle.kts itself should be supported. Android Gradle plugin supports Kotlin DSL and must be applied in the top-level Android build file, either build.gradle or build.gradle.kts.  
Here documentation:  
[Dynatrace Android Gradle plugin](https://docs.dynatrace.com/docs/observe/digital-experience/mobile-applications/instrument-android-app/instrumentation-via-plugin)&nbsp;  
But&nbsp;For React Native,in documentation you can see this:

```markup
npx instrumentDynatrace

```

from the project root and let it apply the configuration from dynatrace.config.js, instead of passing the Gradle file manually.

So this looks more like a limitation or bug in the instrumentDynatrace CLI when using the explicit gradle=android/build.gradle.kts argument, rather than lack of .kts support in Dynatrace itself. I’d recommend:

- making sure android/build.gradle.kts is the top-level Android build file
- running npx instrumentDynatrace without the manual gradle=… argument
- and if it still fails, opening a Dynatrace support case because the docs say build.gradle.kts is supported

[Instrument mobile apps with Dynatrace React Native plugin](https://docs.dynatrace.com/docs/observe/digital-experience/mobile-applications/cross-platform-frameworks/react-native)

---

<div class="post-metadata">

**Author:** ![AndreiEKB](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@AndreiEKB](https://community.dynatrace.com/u/AndreiEKB)\
**Post date:** [April 21, 2026, 7:22am UTC](https://community.dynatrace.com/t/npx-instrumentdynatrace-gradle-android-build-gradle-kts-fails/55547/3 "2026-04-21T07:22:07Z")

</div>

The issue is resolved, please expect it in the version 2.337.1
