未定义不是对象(评估 'Sn[e]') [英] Undefined is not an object (evaluating 'Sn[e]')

查看:46
本文介绍了未定义不是对象(评估 'Sn[e]')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android 上收到此错误:

I'm getting this error on Android:

我在'index.android.bundle'中找到了代码行'Sn[e]',我粘贴在下面(ctrl/command + F):

I have found that line of code 'Sn[e]' in 'index.android.bundle' which I have pasted below (ctrl/command + F):

for (var An in Sn) xn[An] = Sn[An];
 for (var Dn in wn) Pt(!Sn[Dn], "Event cannot be both direct and bubbling: %s", Dn), xn[Dn] = wn[Dn];
 var kn = {
   eventTypes: En({}, Sn, wn),
   extractEvents: function(e, t, n, o) {
    var r = Sn[e],
     i = wn[e],
     a = Pn.getPooled(r || i, t, n, o);
    if (r) fn.accumulateTwoPhaseDispatches(a);
    else {
     if (!i) return null;
     fn.accumulateDirectDispatches(a)
    }
    return a
   }
  },
  jn = kn,
  On = {
   handleTopLevel: function(e, t, n, o) {
    G(sn.extractEvents(e, t, n, o))
   }
  },
  Mn = On,
  Hn = 1,
  Un = {
   tagsStartAt: Hn,
   tagCount: Hn,
   allocateTag: function() {
    for (; this.reactTagIsNativeTopRootID(Un.tagCount);) Un.tagCount++;
    var e = Un.tagCount;
    return Un.tagCount++, e
   },
   assertRootTag: function(e) {
    It(this.reactTagIsNativeTopRootID(e), "Expect a native root tag, instead got %s", e)
   },
   reactTagIsNativeTopRootID: function(e) {
    return e % 10 == 1
   }
  },
  Fn = Un,
  Wn = null,
  Ln = {
   injectFiberControlledHostComponent: function(e) {
    Wn = e
   }
  },
  Bn = null,
  Yn = null,
  Vn = {
   injection: Ln,
   enqueueStateRestore: function(e) {
    Bn ? Yn ? Yn.push(e) : Yn = [e] : Bn = e
   },

看起来像一段 React 代码,因为它有 injectFiberControlledHostComponent 看起来像 React Native Fiber.知道如何解决这个问题吗?

Looks like a React piece of code because it has injectFiberControlledHostComponent which seems like React Native Fiber. Any idea how I can fix this?

我在 android studio 中启动了应用程序并且没有错误,因为应用程序构建和安装正常.我确实在 android studio gradle 控制台中看到过这个,但这可能不是问题:

I started the app in android studio and no errors because the app builds and installs fine. I did see this in the android studio gradle console but it's probably not the issue:

注意:/Users/Ben/Development/Projects/vepo/frontend/android/app/src/main/java/com/vepo/MainApplication.java使用或覆盖已弃用的 API.注意:重新编译-Xlint:弃用详情.

Note: /Users/Ben/Development/Projects/vepo/frontend/android/app/src/main/java/com/vepo/MainApplication.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

推荐答案

我遇到了同样的问题并通过将 app/build.gradle 更改为:

I faced the same problem and fixed by changing app/build.gradle as:

编译com.facebook.react:react-native:+"

compile ("com.facebook.react:react-native:+") {力 = 真;}

另见:https://github.com/facebook/react-native/issues/17840

这篇关于未定义不是对象(评估 'Sn[e]')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆