首次构建后出现React-native-firebase错误

时间:2018-02-26 13:52:29

标签: react-native-firebase

我正在为Android和iOS开发跨平台应用程序,并选择使用react-native-firebase。我从react-native-firebase免费入门套件中克隆了该项目。当我第一次使用“npm run android”构建我的应用程序时,它工作正常,但第二次出现错误:

  

任务执行失败':app:processDebugGoogleServices'。   无法删除:C:\\ android \ app \ build \ generated \ res \ google-services \ debug

要在Android Studio模拟器中再次运行应用程序,我必须手动删除构建文件夹并再次运行“npm run android”,以便创建一个新的。为什么会发生这种情况,我该如何解决?

1 个答案:

答案 0 :(得分:0)

我有同样的问题。

不过,作为一种解决方法,我不清理build文件夹:我再次开始构建(react-native run-android),它开始运行。

我可能不得不重复几次。

因此,这意味着问题与构建过程中的同步有关。 我尝试在gradle.properties中设置:

Pane root = new Pane();

Separator top = new Separator(Orientation.HORIZONTAL);
top.setPrefWidth(1310);

Separator left = new Separator(Orientation.VERTICAL);
left.setPrefHeight(150);

left.setPadding(new Insets(0,0,10,0));
Separator low = new Separator(Orientation.HORIZONTAL);

low.setPadding(new Insets(140,10,0,0));
low.setPrefWidth(1323);

Separator right = new Separator(Orientation.VERTICAL);
right.setPrefHeight(150);

right.setPadding(new Insets(0,0,10,1310));


Label descuento = new Label("Descuento: ");

Label sub = new Label("Sub-Total: ");

Label iva = new Label("Iva: ");

Label total = new Label("Total: ");

Label rsub = new Label("0000.00");

Label riva= new Label("16%");

Label rtotal = new Label("0.0000");


Button btn_generate = new Button("generate");

MenuItem opc = new MenuItem("Opc");
MenuItem opc1= new MenuItem("opc1");

MenuButton menu1 = new MenuButton("Type",null,opc,opc1);

MenuItem opc2 = new MenuItem("opc2");
MenuItem opc3 = new MenuItem("opc3");

MenuButton menu2 = new MenuButton("Opc",null,opc2,opc3);


GridPane Gtotal = new GridPane();

Gtotal.setHgap(20);
Gtotal.setVgap(10);
Gtotal.setPadding(new Insets(10,0,0,10));

ColumnConstraints column1 = new ColumnConstraints(rtotal.getPrefWidth(),rtotal.getPrefWidth(),rtotal.getPrefWidth());
ColumnConstraints column2 = new ColumnConstraints(total.getPrefWidth()+450,total.getPrefWidth()+450,total.getPrefWidth()+450);
ColumnConstraints column3 = new ColumnConstraints(riva.getPrefWidth(),riva.getPrefWidth(),riva.getPrefWidth());
ColumnConstraints column4 = new ColumnConstraints(iva.getPrefWidth()+330,iva.getPrefWidth()+330,iva.getPrefWidth()+330);
ColumnConstraints column5 = new ColumnConstraints(rsub.getPrefWidth(),rsub.getPrefWidth(),rsub.getPrefWidth());
ColumnConstraints column6 = new ColumnConstraints(sub.getPrefWidth(),sub.getPrefWidth(),sub.getPrefWidth());

Gtotal.getColumnConstraints().add(0,column1);
Gtotal.getColumnConstraints().add(0,column2);
Gtotal.getColumnConstraints().add(0,column3);
Gtotal.getColumnConstraints().add(0,column4);
Gtotal.getColumnConstraints().add(0,column5);
Gtotal.getColumnConstraints().add(0,column6);

GridPane.setConstraints(descuento, 0, 0);
GridPane.setConstraints(menu1, 1, 0);
GridPane.setConstraints(menu2, 2, 0);
GridPane.setConstraints(sub, 0, 1);
GridPane.setConstraints(rsub, 1, 1);

GridPane.setConstraints(iva, 2, 1);
GridPane.setHalignment(iva, HPos.RIGHT);

GridPane.setConstraints(riva, 3, 1);

GridPane.setConstraints(total, 4, 1);
GridPane.setHalignment(total, HPos.RIGHT);

GridPane.setConstraints(rtotal, 5, 1);
GridPane.setConstraints(btn_generate, 5, 2);

Gtotal.getChildren().addAll(descuento,sub,rsub,iva,riva,total,rtotal,btn_generate,menu1,menu2);

root.getChildren().addAll(top,left,Gtotal,low,right);

Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();

到现在为止一切正常!