NoClassDefFoundError:实例化StorageClient时引发io / opencensus / trace / Tracestate

时间:2019-05-29 20:44:28

标签: firebase google-cloud-storage

我有一个Spring Boot 2.1应用程序,我只是遵循Firebase网站上的文档,但是我正在获取java.lang.NoClassDefFoundError:io / opencensus / trace / Tracestate。

class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      show: false,
    }
  }

  componentDidMount() {
    setTimeout(() => this.setState({ show: true}), 200);
  }

  render() {
    return (
      <ReactVivus
        className={this.state.show ? "svg-show" : "svg"}
        option={{
          file: forever,
          duration: 200,
          animTimingFunction: "oneByOne",
          type: "delayed",
          onReady: console.log
        }}
        callback={console.log}
      />
    )
  }
}

我找不到与此相关的任何信息,也无法弄清这里出了什么问题。

编辑: 我的pom.xml,firebase admin和google cloud storage中都具有依赖项,删除firebase admin时错误停止发生。

public void initialize() {
    InputStream serviceAccount = getClass()
        .getClassLoader().getResourceAsStream(CREDENTIALS_PATH);

    FirebaseOptions options = new FirebaseOptions.Builder()
           .setCredentials(GoogleCredentials.fromStream(serviceAccount))
            .setStorageBucket(BUCKET_NAME)
            .build();

    FirebaseApp.initializeApp(options);

    StorageClient storageClient = StorageClient.getInstance(); // This line is throwing the exception
}

0 个答案:

没有答案