Android: Didn't find class “Picasso” on path:

2019-05-14 20:26发布

First of all I know this error has been asked already but my case is a little different:

I'm distributing SDK (Android library project). My SDK needs among others things (play services, support v4, gson jars etc.) Picasso so I have in my gradle.build:

compile 'com.squareup.picasso:picasso:2.5.2'

Now when I test importing the resulted aar file from this library project to my sample app - all works fine.

The problem is that my customer when importing the aar file into his app project, trying to launch inside his app the Activity related with my SDK functionality getting the above error:

Failed resolution of: Lcom/squareup/picasso/Picasso:
java.lang.ClassNotFoundException: Didn't find class "com.squareup.picasso.Picasso" on path: DexPathList[[zip file "/data/app/com.package.name-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

Note: I do need inside this Activity Picasso. We both use Android studio.

My question is where is the problem? Inside my library? In the way the customer integrates the aar?

  • The customers needs to modify his build.gradle with all my SDK's dependencies because I'm not distributing via maven
  • and also include my Activities inside his manifest.xml
  • Maybe the multidex has something to do here?
  • Maybe version of play services?
  • Maybe version of support lib V4 VS. appcompat V7?
  • Collusion in dependencies versions between what the customer compiled and what I compiled?
  • Order of dependencies in the gradle.build?

1条回答
forever°为你锁心
2楼-- · 2019-05-14 21:19

You have to disable "Instant Run"

查看更多
登录 后发表回答