-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Summary
When following the official setup docs, the recommended developer mode manifest entry:
<meta-data
android:name="com.meta.wearable.mwdat.APPLICATION_ID"
android:value="0" />is silently ignored by the SDK. Android's manifest parser infers "0" as an Integer, and Bundle.getString() returns null when it encounters a non-String type:
Bundle W Key com.meta.wearable.mwdat.APPLICATION_ID expected String but value was a java.lang.Integer. The default value <null> was returned.
Bundle W Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at android.os.BaseBundle.getString(BaseBundle.java:1416)
at com.meta.wearable.dat.core.internal.configuration.DatConfiguration$Companion.getStringFromManifest(...)
This is a well-known Android behavior with <meta-data> values that look numeric. The same issue will affect production apps whose Application IDs from the Wearables Developer Center happen to be purely numeric.
Workaround
Prefix the value with \ to force string type:
<meta-data
android:name="com.meta.wearable.mwdat.APPLICATION_ID"
android:value="\0" />Suggested fix
The SDK should read the value using Bundle.get() and call .toString(), rather than Bundle.getString(). The docs should also be updated to use \0 instead of 0.
Affected version
com.meta.wearable:mwdat-core:0.4.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels