Skip to content

Unresolved Reference: Theme_AppCompat_NoActionBar in Android Project #392

Open

Description

@dschandrasekara

The flutter_mapbox_navigation plugin causes build failures due to unresolved references to Theme_AppCompat_NoActionBar in the following files:

  • NavigationActivity.kt
  • EmbeddedNavigationViewFactory.kt

This issue occurs because the required AppCompat theme is either not included in the plugin's dependencies or improperly referenced.

Steps to Reproduce:

  1. Add flutter_mapbox_navigation version 0.2.2 to a Flutter project.
  2. Build the project for Android using flutter build apk.

Observed Error:

Unresolved reference 'Theme_AppCompat_NoActionBar' in:
- NavigationActivity.kt (line 84)
- EmbeddedNavigationViewFactory.kt (line 35)

Activity

  1. 22chiragmodh commented on Jun 3, 2025

    @22chiragmodh

    You need to add implementation 'com.google.android.material:material:1.8.0'
    line into root project/android/app/build.gradle dependencies block like below

    dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.8.0' // other dependencies... }

    • instead of setTheme(R.style.Theme_AppCompat_NoActionBar) use setTheme(com.google.android.material.R.style.Theme_MaterialComponents_NoActionBar) in NavigationActivity.kt file

    • instead of activity.setTheme(R.style.Theme_AppCompat_NoActionBar) use activity.setTheme(com.google.android.material.R.style.Theme_MaterialComponents_NoActionBar) in EmbeddedNavigationViewFactory.kt file.

    your issues will solved after above changes.

  2. Krupal001 commented on Aug 6, 2025

    @Krupal001

    instead of activity.setTheme(R.style.Theme_AppCompat_NoActionBar) use activity.setTheme(R.style.AppTheme) in EmbeddedNavigationViewFactory.kt file.
    and also in NavigationActivity.kt file and your issue is resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions