Skip to content

Custom Pub Dependency background_location_2 not resolving in Custom Actions #7407

Description

@imthiyaj92-gif

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

I added the background_location_2 package as a Custom Pub Dependency in FlutterFlow. The dependency is visible in Project Dependencies, but my Custom Action cannot resolve the package.

I am getting the following error:
Target of URI doesn't exist: package:background_location_2/background_location.dart

Because of this, BackgroundLocation is also shown as undefined.

I have tried re-adding the dependency, changing the package version, refreshing/rechecking the code, and verifying the import, but the issue still remains.

Expected Behavior

The background_location_2 package should resolve correctly after being added under Custom Pub Dependencies, and the Custom Action should recognize BackgroundLocation without URI or undefined-name errors.

Steps to Reproduce

1.Open a FlutterFlow project.
2.Go to Project Dependencies → Custom Pub Dependencies.
3.Add background_location_2 with version ^0.16.3.
4.Create a Custom Action.
5.Add the import: import 'package:background_location_2/background_location.dart';
6.Use BackgroundLocation in the Custom Action.
7.Run the code error check.
8.FlutterFlow reports: Target of URI doesn't exist and Undefined name 'BackgroundLocation'.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

IT4oi/LqyIt1ofVY15CIbcdogSQQG2E2U7hIi8pBcywgfZzzBLN/fPfQP1hVOMO/dFY3OlmKjm0d1vfqhc7PVsY6G02cY758+pZidgzMTl6lbpebBquJfW1RGe5UGlCy06evsSNSHNZYLWNh11+Mf97LcHLDGKGwOUYzGOWLLdeK2SrDX1iXc2URm05KZDPz

Visual documentation

Image Image

Screenshots attached showing the Custom Action code, the background_location_2 import, and the resulting "Target of URI doesn't exist" / "Undefined name 'BackgroundLocation'" errors.

Environment

- FlutterFlow version: Current web version
- Platform:Web
- Browser name and version:Google Chrome
- Operating system and version affected: Windows 11
Custom Pub Dependency: background_location_2 ^0.16.3

Additional Information

This issue is blocking the implementation of background location tracking in my app. The dependency appears correctly under Custom Pub Dependencies, but FlutterFlow's Custom Action editor cannot resolve it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions