Closed rusxakep closed 6 years ago
Hi, @rusxakep! I met similar problems after migration app to build gradle tools 3 with other libraries, but after simple project rebuild error was gone. Did you try it?
This isn't proguard problem. Conflict with R.class in content-resolver-2.1.0 and sqlite-2.1.0. Removing R.class from any .jar fixes the problem.
hi, I'm confirm it
Caused by: com.android.dex.DexException: Multiple dex files define Lcom/pushtorefresh/storio2/R;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
@rusxakep @Sar777 indeed that happens, looks like for some reason build tooling decides that packageName of every module is com.pushtorefresh.storio2
instead of module-specific one like com.pushtorefresh.storio2.sqlite
which we actually set in AndroidManifest
of every module.
For now I recommend you to try depending on aar
versions of our dependencies like this:
compile 'com.pushtorefresh.storio2:sqlite:2.0.0@aar'
Because turned out R
class doesn't get packaged into aar, but packaged into jar
@artem-zinnatullin thx!
@Sar777 did it work for you? Just want to confirm :)
yes, work fine
Great, thanks!
// If you need StorIO for SQLite
compile 'com.pushtorefresh.storio2:sqlite:2.1.0@aar'
compile 'com.pushtorefresh.storio2:sqlite-annotations:2.1.0'
annotationProcessor 'com.pushtorefresh.storio2:sqlite-annotations-processor:2.1.0'
// If you need StorIO for ContentResolver
compile 'com.pushtorefresh.storio2:content-resolver:2.1.0'
compile 'com.pushtorefresh.storio2:content-resolver-annotations:2.1.0'
annotationProcessor 'com.pushtorefresh.storio2:content-resolver-annotations-processor:2.1.0'
Workaround work fine, thanks.
And