React Native - APK 生成失败

React Native - APK generation failed

伙计们。 我m work on RN app. In the dev process everything work fine, the app launched at my device, but when i tried generate APK, i会遇到下一条错误消息:

SyntaxError D:/Sites/work/CECI/src/stores/AppStore.js: Unexpected token (12:4)

:app:bundleReleaseJsAndAssets FAILED

BUILD FAILED

Total time: 43.156 secs

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:bundleReleaseJsAndAssets'.

    Process 'command 'cmd'' finished with non-zero exit value 1

  • 尝试:运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。

进程已完成,退出代码为 1

AppStore.js 的开头:

import {action, computed, observable, toJS} from 'mobx';
import {forEach, size, flatMap, sortBy, last} from 'lodash';
import firebase from 'react-native-firebase';
import store from 'rn-object-store';
import moment from 'moment';


const auth = firebase.auth();
const db = firebase.firestore();

class AppStore {
    @observable user = null;
    @observable auth = {
        authUser:  null,
        authError: null,
        loggedIn:  null
    };
    @observable userRef = null;
    @observable decisionsRef = null;
    @observable quizzesRef = null;
    @observable _decisions = {};
    @observable _quizzes = {};
    @observable activeQuestion = 0;
    @observable activeQuiz = null;
    @observable activeDecision = null;
    @observable reports = {};

所以如果我理解有问题的右行是 @observable user = null; 有什么问题吗?

试试 cd android && ./gradlew clean