DJtiwari
DJtiwari

Reputation: 519

Android package does not exist issue in maven android project

I am getting android package error in maven android project while installing maven build.

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;

cannot find symbol [ERROR] symbol: class Bitmap

package android.content does not exist

I added following dependencies in pom.xml and also installed via maven android deployer

 <dependencies>
        <dependency>
            <groupId>android</groupId>
            <artifactId>android</artifactId>
            <version>1.6_r2</version>
            <scope>provided</scope>
        </dependency>



    <dependency>
            <groupId>android.support</groupId>
            <artifactId>compatibility-v4</artifactId>
            <version>20.0.0</version>
        </dependency>

Upvotes: 0

Views: 1490

Answers (1)

Born To Win
Born To Win

Reputation: 3329

Add the following in your pom.xml.

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>1.5_r4</version>
    <scope>provided</scope>
  </dependency>

Otherwise Right click in your Maven project->Select Maven->Select Add Dependency->Search And add your dependecy related to android.

Hope it will helps you.

Upvotes: 1

Related Questions