Bar*_*Ros 6 java android object release-mode firebase
我写了一个将实时位置数据推送到Firebase的方法:
private void writeNewMarker(int sessionType, String myUuid, String datetime, Location location) {
locationToDB = new LocationFromAndroid();
JSONObject jsonObjectCoords = new Coords(location.getLatitude() + "", location.getLongitude() + "", location.getAltitude() + "");
locationToDB.setFinish("false");
locationToDB.setLost("false");
locationToDB.setCoords(jsonObjectCoords);
locationToDB.setDistanceToGo("0");
locationToDB.setHeading(location.getBearing() + "");
locationToDB.setNauwkeurigheid(location.getAccuracy() + "");
locationToDB.setSpeed(location.getSpeed() * 3.6 + "");
locationToDB.setSpeed2(location.getSpeed() + "");
locationToDB.setTimestamp(location.getTime() + "");
locationToDB.setWp_user(myUuid);
locationToDB.setSessionType(sessionType);
locationToDB.setTitle(title);
if(myUuid != null && datetime != null && locationToDB.getTitle() != null && !myUuid.isEmpty() && !datetime.isEmpty()) {
databaseRef.child(myUuid + "-Android" + sessionType + datetime).setValue(locationToDB);
Run Code Online (Sandbox Code Playgroud)
当我在调试模式下构建应用程序时,它完全正常.但是,当我在Google Play的发布模式下构建它时,它会停止在此行上工作:
databaseRef.child(myUuid + "-Android" + sessionType + datetime).setValue(locationToDB);
Run Code Online (Sandbox Code Playgroud)
更具体一点:当我这样做时,一切都很好:
databaseRef.child(myUuid + "-Android" + sessionType + datetime).setValue("Test");
Run Code Online (Sandbox Code Playgroud)
它看起来像传递一个对象,因为在签名的APK中无法获得值?
错误: 异常com.google.firebase.database.DatabaseException:没有要在类上找到的序列化属性