首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >read本机: Android构建- App.js:无法读取属性null的“绑定”

read本机: Android构建- App.js:无法读取属性null的“绑定”
EN

Stack Overflow用户
提问于 2018-12-12 22:49:50
回答 2查看 1.3K关注 0票数 0

我正在努力构建我的项目,但它已经变成了一个噩梦.

现在当我运行./gradlew assembleRelease时,我面临着这个问题

代码语言:javascript
复制
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssets'.

更具体而言:

代码语言:javascript
复制
transform[stderr]: Trace: The node type SpreadProperty has been renamed to SpreadElement
transform[stderr]:     at Object.isSpreadProperty (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/types/lib/validators/generated/index.js:4208:11)
transform[stderr]:     at hasSpread (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:38:13)
transform[stderr]:     at PluginPass.ObjectExpression (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:234:14)
transform[stderr]:     at newFn (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/visitors.js:193:21)
transform[stderr]:     at NodePath._call (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:53:20)
transform[stderr]:     at NodePath.call (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:40:17)
transform[stderr]:     at NodePath.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:88:12)
transform[stderr]:     at TraversalContext.visitQueue (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/context.js:118:16)
transform[stderr]:     at TraversalContext.visitSingle (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/context.js:90:19)
transform[stderr]:     at TraversalContext.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/context.js:146:19)

App.js: Cannot read property 'bindings' of null

TypeError: Cannot read property 'bindings' of null
    at Scope.moveBindingTo (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/scope/index.js:867:13)
    at BlockScoping.updateScopeInfo (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
    at BlockScoping.run (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
    at PluginPass.BlockStatementSwitchStatementProgram (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
    at newFn (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/danielrvt/IdeaProjects/my-app/node_modules/@babel/traverse/lib/context.js:118:16)

老实说,我完全不知道现在出了什么问题,我该如何调试呢?

这是我的package.json

代码语言:javascript
复制
{
    "name": "my-app",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "@ptomasroos/react-native-multi-slider": "0.0.12",
        "firebase": "^5.1.0",
        "javascript-time-ago": "^1.0.30",
        "mobx": "^4.1.1",
        "mobx-react": "^5.0.0",
        "native-base": "^2.8.1",
        "prop-types": "^15.6.2",
        "protobufjs": "^6.8.8",
        "react": "16.2.0",
        "react-native": "^0.57.7",
        "react-native-actionsheet": "^2.3.0",
        "react-native-aws3": "0.0.8",
        "react-native-axios": "^0.17.1",
        "react-native-billing": "^2.9.1",
        "react-native-card-stack-swiper": "^1.0.5",
        "react-native-collapsible": "^0.10.0",
        "react-native-cookies": "^3.2.0",
        "react-native-datepicker": "^1.6.0",
        "react-native-dropdownalert": "^3.5.0",
        "react-native-elements": "^0.19.0",
        "react-native-event-listeners": "^1.0.3",
        "react-native-expandable-section-flatlist": "^1.0.3",
        "react-native-fbsdk": "^0.8.0",
        "react-native-fcm": "^16.0.0",
        "react-native-floating-action": "^1.10.1",
        "react-native-geocoding": "^0.3.0",
        "react-native-gifted-chat": "^0.4.3",
        "react-native-google-places-autocomplete": "^1.3.6",
        "react-native-hide-show-password-input": "^1.0.7",
        "react-native-image-crop-picker": "^0.19.3",
        "react-native-image-picker": "^0.26.10",
        "react-native-image-placeholder": "^1.0.14",
        "react-native-instagram-login": "^1.0.7",
        "react-native-keyboard-aware-scroll-view": "^0.4.4",
        "react-native-keyboard-aware-scrollview": "^2.0.0",
        "react-native-keyboard-spacer": "^0.4.1",
        "react-native-linear-gradient": "^2.4.0",
        "react-native-linkedin": "^1.3.1",
        "react-native-localization": "^2.0.0",
        "react-native-material-bottom-navigation": "^0.9.0",
        "react-native-modal-datetime-picker": "^6.0.0",
        "react-native-open-settings": "^1.0.1",
        "react-native-pages": "^0.7.0",
        "react-native-permissions": "^1.1.1",
        "react-native-picker-select": "^5.1.0",
        "react-native-popup-menu": "^0.12.4",
        "react-native-pulse": "^1.0.6",
        "react-native-scrollable-tab-view": "^0.8.0",
        "react-native-share": "^1.0.26",
        "react-native-simple-toast": "0.0.8",
        "react-native-snap-carousel": "^3.7.2",
        "react-native-splash-screen": "^3.1.1",
        "react-native-star-rating": "^1.0.9",
        "react-native-swipe-cards": "^0.1.1",
        "react-native-swipe-list-view": "^1.0.7",
        "react-native-swipeable-flat-list": "0.0.5",
        "react-native-swipeout": "^2.3.3",
        "react-native-switch": "^1.4.0",
        "react-native-twitter-signin": "https://github.com/GoldenOwlAsia/react-native-twitter-signin.git#master",
        "react-native-view-more-text": "^2.0.1",
        "react-native-viewpager": "^0.2.13",
        "react-navigation": "^1.0.3",
        "rn-viewpager": "^1.2.9"
    },
    "devDependencies": {
        "@babel/plugin-proposal-decorators": "^7.2.0",
        "babel-jest": "22.2.2",
        "babel-preset-react-native": "4.0.0",
        "jest": "22.2.2",
        "react-test-renderer": "16.2.0"
    },
    "jest": {
        "preset": "react-native",
        "transform": {
            "^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
        }
    }
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-12-13 03:41:11

来自https://www.npmjs.com/package/babel-preset-react-native

巴别-预置-反应-反应-本机已经被地铁反应-反应-本机-预置,现在使用巴贝尔7.0.0。如果您使用的Reactinative0.57或更高版本,您应该更新您的babel配置,以指向地铁-反应-本机-babel-预设预设。

票数 3
EN

Stack Overflow用户

发布于 2018-12-12 23:22:05

我认为这可能与babel-core的某个特定问题有关,您可以尝试这个解决方案https://github.com/babel/babel/issues/8263#issuecomment-402546923

添加到您的package.json

代码语言:javascript
复制
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3"

然后是npm install

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53752595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档