Home > Mobile >  Android Studio not recognising some packages
Android Studio not recognising some packages

Time:12-06

In my project I have a package com.bi.bio, and within it are packages like "base", "data", "events", "auth" etc. When I try to add my activities to the manifest from, say, "auth", the "auth" package is not recognised - with message "class referenced not found in project or libraries". Similarly some other packages like "events" are not recognised, while some packages, say "base", are getting recognised.

This image shows my project structure:

Project Structure

This image shows the error while trying to add an Activity in a package, in manifest:

Manifest error

What do I do to make Android Studio recognise all my packages.

CodePudding user response:

Actually, had forgotten to set the package name properly in the Activity concerned, after copying the Activity from another module.

Worked after correcting the package name in my Activity.

CodePudding user response:

Try:-

  1. Rebuilding the project

    Build -> Rebuild

  2. Invalidate cache.

    File -> Invalidate cache and restart

CodePudding user response:

In Manifest file Enter PackageName Like this

package="com.bi.bio"

Like this, you can add activity in the manifest file.

  • Related