我有云功能项目,我将项目从旧笔记本电脑移到了新笔记本电脑。
我已经安装了所有必要的东西。我的问题是当我尝试“firebase deply”时,它给了我这个错误:
! functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.
我做了我被告知的事情,但它仍然给我同样的错误。我该怎么办?我如何将 npm install 定向到我的函数目录?
我正在使用 Firebase 存储来保存视频/音频用户的文件。我的主要想法是将每个视频/音频保存在用户 ID (UID) 下。这意味着每个用户都有几个视频/音频文件保存在他的 UID 下。我写了一个代码,问题是他一直在我保存的旧视频上保存新视频。请告诉我我错在哪里
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == PICK_VIDEO_REQUEST) {
Uri selectedVideoUri = data.getData();
String userUid = FirebaseAuth.getInstance().getCurrentUser().getUid();
StorageReference storageRef = FirebaseStorage.getInstance().getReference();
videoRef = storageRef.child("/videos/" + userUid );
//TODO: save the video in the db
uploadData(selectedVideoUri);
}else if(requestCode == PICK_AUDIO_REQUEST){
//TODO: save the audio in the db
}
}
}
private void uploadData(Uri videoUri) {
if(videoUri != null){
UploadTask uploadTask = videoRef.putFile(videoUri); …Run Code Online (Sandbox Code Playgroud) 我是 Python 新手。我正在尝试做某事,但不确定是否可能。我想创建一个运行 1 个函数的线程,并在完成后运行另一个函数。
例如
thread.start_new_thread( func1 )
//Run this thread only after the first one was finished
thread.start_new_thread( func2 )
Run Code Online (Sandbox Code Playgroud)
是否可以用 1 个线程来完成?或者我需要创建 2 个线程?我应该怎么办?
我正在尝试在recyclerview上显示我的模型列表.但由于某种原因,它没有显示任何东西.我从FirebaseDatabase获取列表项并将所有数据保存在"videoList"上.然后我想呈现我收到的数据,但它没有显示任何内容.
请告诉我我做错了什么.
public class MyPlayListFragment extends Fragment {
private FirebaseDatabase refToVideos;
private FirebaseUser currentUser;
private ArrayList<Video> videosList;
private VideoViewAdapter adapter;
private RecyclerView rvVideos;
public MyPlayListFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_my_play_list, container, false);
rvVideos = (RecyclerView)v.findViewById(R.id.rvVideos);
return v;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
videosList = new ArrayList<>();
refToVideos = FirebaseDatabase.getInstance();
currentUser …Run Code Online (Sandbox Code Playgroud)