Kiwix-android: Unable to build the project - Gradle pluggin version issue

Created on 26 Mar 2019  Â·  20Comments  Â·  Source: kiwix/kiwix-android

Describe the bug

The project gives me this error
Could not get unknown property 'androidGradlePluginVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

when I try to build the code.

Expected behavior

the project is supposed to run properly , as I haven't changed it a bit.

Screenshots

Screenshot from 2019-03-26 22-14-16

Environment

  • Version of Kiwix Android :
  • Device : Galaxy J6
  • OS version : Ubuntu 18.0.4
question

All 20 comments

Before building do make sure you have done this:

Build Variants select Kiwix-debug
delete .idea folder
and build again

or simply use 3.3.0 there

If this persists please provide significantly more detail.

@gptshubham595 I have tried everything you had mentioned , but nothing seems to work

I am not able to chose the build variant (the option isn't highlighted)
the build.gradle file inside has problems in multiple import statements

Screenshot from 2019-03-27 21-21-02

There also seems to be 2 different build.gradle files , the outside one is empty

Empty? It shouldn't be empty. Can you screenshot the build variant list?

the build.gradle file outside the app folder
Screenshot from 2019-03-27 21-44-34

The build.gradle file inside the app folder
Screenshot from 2019-03-27 21-45-05

Build->select build variant
option is disabled

I am actually lost now
Nothing in stack overflow seems to be working
To your knowledge is there anything else left to try?

Thank you for your time

On Wed, 27 Mar 2019 at 21:32, Isaac Hutt notifications@github.com wrote:

Empty? It shouldn't be empty. Can you screenshot the build variant list?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/kiwix/kiwix-android/issues/1129#issuecomment-477226753,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AjY0l-D7NT8crasxBlzWQ-x2AtjPFsg-ks5va5YbgaJpZM4cL75i
.

I am also facing the same issue, someone please guide me on how to import the project in Android studio properly

Make sure you are using the latest version of android studio and you are importing the project from its root. If that doesn't work try ./gradlew build and report what the output from that is.

image



A problem occurred evaluating project ':app'.

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





This is the error that we are facing

I think the issue is that you created a build.gradle file in the outer directory. This shouldn't be there. You should be using the build.gradle.kts delete it and reimport

Updating our gradle wrapper version to 5.2 should hopefully smooth the process a bit.

I tried deleting the build.gradle in the outer directory .
But it just gets created again

I am continuously getting this "Could not get unknown property
'androidGradlePluginVersion'" error no matter what I do.

On Sun, 31 Mar 2019 at 02:21, Isaac Hutt notifications@github.com wrote:

Updating our gradlew wrapper version to 5.2 should hopefully smooth the
process a bit.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/kiwix/kiwix-android/issues/1129#issuecomment-478288311,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AjY0l1tdo7wObnPWDpKiQJNV3yinxFREks5vb849gaJpZM4cL75i
.

So I finally build the project successfully
Here is what I did..

  1. first delete .idea folder
  2. in the root folder delete the automatically created build.gradle file and rename build.gradle.kts file to build.gradle
  3. in build.gradle file remove the last four lines starting from tasks.create.. line and save
  4. Now select import in android studio and select the folder
  5. After completion of gradle build and indexing click on build variants option on left corner of android studio
  6. Over there select app as kiwix-debug
  7. Thats it. Now,you can run the project successfully.

Same thing i said 😅

Hey Nitish
I tried exactly what you told , Did you get any error like
org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;

On Sun, 31 Mar 2019 at 19:57, Shubham gupta Ggps notifications@github.com
wrote:

Same thing i said 😅

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/kiwix/kiwix-android/issues/1129#issuecomment-478346695,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AjY0l7BGWq9UobEiPdhrqiIlSQKMFhksks5vcMXBgaJpZM4cL75i
.

No I didn't got any error like that except few warnings,
Which doesn't cause any issues actually

If you can't build then I suggest recloning with a new directory. It seems there is now a fix so I am closing this.

What's the point of kiwix-android/app/gradle/wrapper ? This will throw off fdroidbuilder and tries to use Gradle 3.3 to build and fails, since it's too old.

Ref: https://gitlab.com/fdroid/fdroiddata/blob/master/metadata/org.kiwix.kiwixmobile.txt#L96

@licaon-kter I would recommend to open a new ticket, commenting on old closed ticket is not recommended, in particular if this is unclear if your question is related (It is for me at least).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RaiLokesh picture RaiLokesh  Â·  4Comments

yashk2000 picture yashk2000  Â·  5Comments

abdulwd picture abdulwd  Â·  4Comments

chstdu picture chstdu  Â·  6Comments

kelson42 picture kelson42  Â·  6Comments