0

I have 3-days(and night) problem while compiling my test project via gradle

My error is

error: package org.holoeverywhere.app does not exist
import org.holoeverywhere.app.Activity;

I have the following structure:

MySimpleProject
-SimpleApp
--build.gradle
-settings.gradle
-build.gradle

My SimpleApp depends HoloEverywhere library.

build.gradle from MySimpleProject is

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}

setting.gradle from MySimpleProject is

include ':SimpleApp'

build.gradle from SimpleApp

apply plugin: 'android'

repositories {
    mavenCentral()
    mavenLocal()
}
dependencies {
    compile 'org.holoeverywhere:library:1.6.1'
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"
}

Log

./gradlew build
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
:SimpleApp:prepareDebugDependencies
:SimpleApp:compileDebugAidl UP-TO-DATE
:SimpleApp:generateDebugBuildConfig UP-TO-DATE
:SimpleApp:mergeDebugAssets UP-TO-DATE
:SimpleApp:compileDebugRenderscript UP-TO-DATE
:SimpleApp:mergeDebugResources UP-TO-DATE
:SimpleApp:processDebugManifest UP-TO-DATE
:SimpleApp:processDebugResources UP-TO-DATE
:SimpleApp:compileDebug
/home/oleg/AndroidStudioProjects/MySimpleProject/SimpleApp/src/main/java/com/example/mysimpleapp/LoginActivity.java:19: error: package org.holoeverywhere.app does not exist
import org.holoeverywhere.app.Activity;

Can anybody help me?

sagus_helgy
  • 1,417
  • 1
  • 18
  • 30

4 Answers4

3

This repo contains the generated aar format, simply add:

repositories {
    maven {
        url 'https://github.com/Goddchen/mvn-repo/raw/master/'
    }
    mavenCentral()
}

To your gradle repositories and add:

dependencies {
  compile "org.holoeverywhere:holoeverywhere:1.6.8"
}
Aldo Borrero
  • 547
  • 4
  • 11
1

This library is only published as an apklib which the gradle plugin does not support.

Xavier Ducrohet
  • 28,383
  • 5
  • 88
  • 64
  • I find out jar library - http://search.maven.org/remotecontent?filepath=org/holoeverywhere/library/1.6.1/library-1.6.1.jar – sagus_helgy Jun 06 '13 at 07:38
  • 1
    This is the code only. To actually use the library you need the content of the apklib as well (it contains the manifest and the res folder). However this is a format that is not understood by the Gradle plugin. It uses a different format (aar) that contains both the jar and the res together. The Maven plugin will migrate to it at some point. – Xavier Ducrohet Jun 06 '13 at 15:50
1

Android Studio: at the build.gradle dependencies copy and paste this:

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}
Mazen Kasser
  • 3,559
  • 2
  • 25
  • 35
0

Inspired by this answer, these are the steps I did:

Put the jar file (in my case, 'something.jar') into the libs folder of your project Right click it and select Add as library Type this in the dependencies part of build.gradle file: compile files('libs/something.jar') Do a clean build. It can be done inside the android studio, but I also ran the gradlew.bat included inside the project folder Now, the project should be built and run just fine.

Community
  • 1
  • 1
Sathish
  • 1,455
  • 1
  • 16
  • 22