2016-06-18 45 views
0

我正在阅读Android Wear手表的GPS数据,然后使用Fitness.HistoryAPI插入Google健身数据存储。但一些记录被拒绝,5015个错误,这显然意味着: `INCONSISTENT_PACKAGE_NAMESpurious Google Fit 5015错误?

状态代码表示该应用程序试图对一个数据源,不应用程序的包name.`

所以匹配插入数据dataSource不是自定义的,并且所有记录中的所有数据源都是相同的,但只有一些被拒绝。

下面看到一些日志记录信息:...

V: Data Source DataSource{raw:Application{com.google.android.gms::null}:Device{Sony:SmartWatch 3:15e991d4::3:2}::DataType{com.google.location.sample[latitude(f), longitude(f), accuracy(f), altitude(f)]}}: device Device{Sony:SmartWatch 3:15e991d4::3:2} and type: com.google.location.sample 
V: Data source for LOCATION_SAMPLE found! Registering. 
V: DataPoint: Time=1466284820248, Source=DataSource{raw:Application{com.google.android.gms::null}:Device{Sony:SmartWatch 3:15e991d4::3:2}::DataType{com.google.location.sample[latitude(f), longitude(f), accuracy(f), altitude(f)]}} 
V: latitude = 37.28372 
V: longitude = -122.024345 
V: accuracy = 50.0 
V: altitude = unset 
V: Recording... 
V: DataPoint: Time=1466284823387, Source=DataSource{derived:Application{com.google.android.gms::null}:Device{Sony:SmartWatch 3:15e991d4::3:2}:default:DataType{com.google.activity.sample[activity(i), confidence(f)]}} 
V: activity = 3 
V: confidence = 100.0 
V: Recording... 
V: DataPoint: Time=1466284826561, Source=DataSource{raw:Application{com.google.android.gms::null}:Device{Sony:SmartWatch 3:15e991d4::3:2}::DataType{com.google.location.sample[latitude(f), longitude(f), accuracy(f), altitude(f)]}} 
V: latitude = 37.28377 
V: longitude = -122.02438 
V: accuracy = 31.0 
V: altitude = 73.0 
V: Recording... 
V: DataPoint: Time=1466284861826, Source=DataSource{derived:Application{com.google.android.gms::null}:Device{Sony:SmartWatch 3:15e991d4::3:2}:default:DataType{com.google.activity.sample[activity(i), confidence(f)]}} 
V: activity = 3 
V: confidence = 100.0 
V: Recording... 
D: Data sets number of points: Speed 0, Location 2, Activity 2 
D: Failed to insert data type com.google.activity.sample for reason 5015 null 
D: Checking inserted fitness data for com.google.location.sample in this period 1466284820000-1466284881000 
D: Failed to insert data type com.google.location.sample for reason 5015 null 
D: Successfully inserted Session Sat, Jun 18; 2:20PM: Period 1 
D: Found 1 data points for data type com.google.location.sample 
V: Timestamp  Latitude Longitude Altitude Accuracy 
V: 1466284826561 37.283772 -122.024384 73.000000 31.000000 

所以有发现了两个位置记录,都与同一dataSourcem但显然其中一人被拒绝(因为你可以看到查询只找到一个5015错误后的位置记录)。

有什么想法?

回答

0

我一直无法找到这个问题的原因(谷歌也没有帮助),但我找到了一个解决方法,通过创建我自己的数据源和关联的数据集,然后从构建的所有数据点进行复制将数据源添加到我自己的数据集中,然后插入这些数据集。