Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
Filing here for visibility since maintainers triage this repo; happy to move it to issuetracker.google.com component 1709065 if that's the preferred venue — this is about the platform/Jetpack shell tooling, not the samples.
Environment: androidx.appfunctions:1.0.0-alpha10 (+ appfunctions-compiler via KSP 2.3.10), @AppFunctionServiceEntryPoint architecture, emulator system-images;android-36.1;google_apis;x86_64, compileSdk 37 / targetSdk 36. Production KMP app (Kotlin, kotlin-inject; no Hilt).
Function under test — registration is correct (list-app-functions shows full typed metadata incl. KDoc descriptions) and binder-side execution works (typed results and typed AppFunctionExceptions round-trip):
@AppFunctionSerializable(isDescribedByKDoc = true)
data class AddItemParams(
val itemName: String,
val listName: String? = null,
val quantity: Double? = null, // <- the field that breaks
val unit: String? = null,
val brand: String? = null,
)
@AppFunction(isDescribedByKDoc = true)
internal suspend fun addItemToGroceryList(params: AddItemParams): AddedItem
Repro:
adb shell "cmd app_function execute-app-function \
--package <pkg> \
--function '<pkg>.BaseSpotAppFunctionService#addItemToGroceryList' \
--parameters '{\"params\": {\"itemName\": \"Apples\", \"quantity\": 3.0}}' \
--timeout-duration 45"
Actual:
Error executing app function: android.app.appfunctions.AppFunctionException:
Parameter params should be the type of AppFunctionReferenceTypeMetadata(
referenceDataType=...$AddItemParams, isNullable=false,description=) (code 1001)
Expected: 3.0 (and integer-form 3) convert into the nullable Double property, as the function metadata advertises the field as DOUBLE.
Isolation: the identical call with only String fields succeeds and creates the item:
--parameters '{"params": {"itemName": "Cheese", "listName": "Groceries"}}' -> OK, typed result
--parameters '{"params": {"itemName": "Apples", "listName": "Groceries", "quantity": 3.0}}' -> code 1001
--parameters '{"params": {"itemName": "Butter", "listName": "Groceries", "unit": "pack"}}' -> OK
So the failure tracks the numeric field, not the JSON envelope. Real agents constructing AppFunctionData binder-side appear unaffected — but the adb shell path is exactly what the AppFunctions agent skill prescribes for local evaluation, so any function with numeric parameters is currently untestable from the shell.
Minor adjacent papercut (arguably WAI): the default execute deadline is shorter than a cold service start + first network fetch, so the first-ever invocation reports Timed out, which reads as a hang. --timeout-duration fixes it; a larger default or a first-run hint would save new adopters the same false diagnosis.
Relevant logcat output
Error executing app function: android.app.appfunctions.AppFunctionException: Parameter params should be the type of AppFunctionReferenceTypeMetadata(referenceDataType=com.tarek.spot.appfunctions.BaseSpotAppFunctionService$AddItemParams, isNullable=false,description=) (code 1001). See logcat for more details.
Code of Conduct
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
Filing here for visibility since maintainers triage this repo; happy to move it to issuetracker.google.com component 1709065 if that's the preferred venue — this is about the platform/Jetpack shell tooling, not the samples.
Environment:
androidx.appfunctions:1.0.0-alpha10(+appfunctions-compilervia KSP 2.3.10),@AppFunctionServiceEntryPointarchitecture, emulatorsystem-images;android-36.1;google_apis;x86_64, compileSdk 37 / targetSdk 36. Production KMP app (Kotlin, kotlin-inject; no Hilt).Function under test — registration is correct (
list-app-functionsshows full typed metadata incl. KDoc descriptions) and binder-side execution works (typed results and typedAppFunctionExceptions round-trip):Repro:
Actual:
Expected:
3.0(and integer-form3) convert into the nullableDoubleproperty, as the function metadata advertises the field as DOUBLE.Isolation: the identical call with only String fields succeeds and creates the item:
So the failure tracks the numeric field, not the JSON envelope. Real agents constructing
AppFunctionDatabinder-side appear unaffected — but the adb shell path is exactly what the AppFunctions agent skill prescribes for local evaluation, so any function with numeric parameters is currently untestable from the shell.Minor adjacent papercut (arguably WAI): the default execute deadline is shorter than a cold service start + first network fetch, so the first-ever invocation reports
Timed out, which reads as a hang.--timeout-durationfixes it; a larger default or a first-run hint would save new adopters the same false diagnosis.Relevant logcat output
Code of Conduct