You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级NativeScript 5.1后Android端启动出现日志信息求助

Troubleshooting Repeating ART Logs After NativeScript 5.1 Upgrade on Android

Hey there, let's walk through actionable steps to diagnose those repeating ART runtime logs you're seeing after upgrading to NativeScript 5.1 and tns-core-modules 5.1.2. First, note that these logs track JS-to-native method calls in the ART VM—while they aren't errors on their own, their repetition points to a loop or unintended repeated invocation somewhere in your setup.

Here's how to dig into it:

  • Verify debug/logging settings aren't amplifying output
    Double-check if you're running the app in debug mode (via tns run android --debug) or if any debug flags are enabled in your code/configuration. Also, check your AndroidManifest.xml to ensure android:debuggable isn't set to true unnecessarily (it should default to false for release builds, but debug builds might trigger more verbose ART logging).

  • Rule out incompatible third-party plugins
    NativeScript 5.1 introduced runtime changes that might break older plugins. Try this:

    1. Temporarily remove all non-essential plugins from your package.json.
    2. Run npm install, then tns clean and rebuild the app.
    3. If the logs disappear, re-add plugins one by one and rebuild each time to find the incompatible one. Check the plugin's repo for updates or issues related to NativeScript 5.1 compatibility.
  • Perform a full cache purge (beyond what you've already done)
    You've deleted core modules, hooks, and the Android platform folder—but there are more caches to clear:

    • Delete your project's node_modules folder and run npm install fresh.
    • Clear Android Gradle caches: Delete the .gradle folder in your project root, plus the global Gradle cache (usually at ~/.gradle/caches on macOS/Linux or C:\Users\<YourUser>\.gradle\caches on Windows).
    • Run tns clean to clear NativeScript's internal cache.
  • Check custom native code/JNI integrations
    If your project uses custom Android Java code or JNI bindings, these might be triggering repeated JS method calls after the runtime upgrade. Look for:

    • Loops in native code that repeatedly call com.tns.Runtime.callJSMethod variants.
    • Mismatches in method signatures between your native code and the updated NativeScript runtime (5.1 might have changed how method arguments are handled).
  • Trace the root JS trigger with verbose logging
    Use NativeScript's trace-level logging to pinpoint which JS method is causing the repeated native calls:
    Run tns run android --log trace—this will output detailed logs that link the ART calls back to specific JS functions. Look for patterns in the trace logs right before the repeating ART entries to identify the problematic code.

  • Check NativeScript 5.1 release notes for known issues
    Review the official NativeScript 5.1 release documentation to see if other users reported similar runtime logging loops, or if there are documented breaking changes related to JS-native method invocation that might apply to your project.

内容的提问来源于stack exchange,提问作者relez

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 09:08:56