Tim Klausmeyer
Tim Klausmeyer

Reputation: 3

How to add POI Android in Android Studio?

I'd like to add POI Android in to Android Studio. The gradle code is this:

implementation "com.github.SUPERCILEX.poi-android:poi:$poiVersion"

But i only get this message:

Could not get unknown property 'poiVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Could you help me?

Upvotes: 0

Views: 5117

Answers (2)

Chintan Soni
Chintan Soni

Reputation: 25267

Open your project-level build.gradle file.

Add below code snippet:

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

Then, inside buildscript, add an object ext as below. Now, define a attribute as poiVersion and assign the value 3.17 to it.

This is similar to defining a variable with name as "poiVersion" and assigning value as "3.17"

buildscript {
    repositories {
        ...
    }

    ext {
        poiVersion = '3.17'
    }

    dependencies {
        ...
    }
}

And to access that variable you can use ${variable_name} as in your case, you used $poiVersion

Upvotes: 3

dnsiv
dnsiv

Reputation: 520

$poiVersion is a placeholder. You need to replace it with a particular version

Upvotes: 1

Related Questions