permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.22k stars 1.44k forks source link

Module depends on one or more Android Libraries but is a jar #35

Closed laomo closed 9 years ago

laomo commented 9 years ago

Warning:Module 'com.github.hotchemi:permissionsdispatcher:1.2.1' depends on one or more Android Libraries but is a jar

laomo commented 9 years ago

In my case, many repositories(JCenter, Central and https://jitpack.io/) in my project. so I need write like this:

dependencies {
  compile 'com.github.hotchemi:permissionsdispatcher:1.2.1@aar'
  apt 'com.github.hotchemi:permissionsdispatcher-processor:1.2.1'
}
HarryMMR commented 8 years ago

I'm still facing the same error. Adding @aar doesn't help either. Somebody help please!

apperside commented 8 years ago

same issue here, any solution? Really can't find out what does it mean!

hotchemi commented 8 years ago

@apperside Have you tried https://github.com/hotchemi/PermissionsDispatcher#download ?

apperside commented 8 years ago

tried what exactly? I followed all the steps indicated but when I sync the project with gradle I receive the error message

Error:Module 'com.github.hotchemi:permissionsdispatcher:2.1.2' depends on one or more Android Libraries but is a jar

I modified the project build.gradle adding

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

to the dipendences

and modified the app build.gradle adding the plugin and the dependencies

gokselguren commented 8 years ago

Encountered same issue

shiraji commented 8 years ago

So, have you guys add following code?

project build.gradle

buildscript {
  dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
  }
}

app build.gradle

apply plugin: 'android-apt'

dependencies {
  compile 'com.github.hotchemi:permissionsdispatcher:2.1.3'
  apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'
}

What is the version of gradlew, Android Studio and android gradle plugin? Could you paste all build.gradle?

jschnall commented 8 years ago

Why was this closed? I'm still seeing the issue. My gradle files look just like what shiraji has posted above, except I also have multiple repos like laomo

Edit: Ok managed to solve it, by appending @aar at the end AND reordering my repos as recommended in the link to the following:

maven { url "http://dl.bintray.com/populov/maven" } mavenCentral() jcenter() maven { url "https://jitpack.io" }

jitpack had to be last for this to work, and bintray had to be first for viewpagerindicator.

hotchemi commented 8 years ago

Yup it's the general problem of Gradle.

XiaoLin1995 commented 6 years ago

Encountered same issue how to fix?

hotchemi commented 6 years ago

@Xiaolin-Zhu https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/35#issuecomment-235432557

vishnu8742 commented 6 years ago

This link solved my problem. https://libraries.io/github/magiepooh/RecyclerViewPager