question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting `ProviderNotFoundException` while comparing .aar files

See original GitHub issue

Was trying to find a diff of one of the privately published library in my team. I’m getting the following stacktrace.

> ./diffuse diff --aar catlib-2.2.1.aar catlib-2.2.4.aar
Exception in thread "main" java.nio.file.ProviderNotFoundException: Provider not found
	at java.nio.file.FileSystems.newFileSystem(FileSystems.java:407)
	at com.jakewharton.diffuse.ExtensionsKt.asZipFileSystem(extensions.kt:28)
	at com.jakewharton.diffuse.ExtensionsKt.asZipFileSystem$default(extensions.kt:28)
	at com.jakewharton.diffuse.io.ZipKt.toZip(Zip.kt:93)
	at com.jakewharton.diffuse.io.PathInput.toZip(Input.kt:43)
	at com.jakewharton.diffuse.Jar$Companion.parse(Jar.kt:21)
	at com.jakewharton.diffuse.Aar$Companion.parse(Aar.kt:29)
	at com.jakewharton.diffuse.DiffCommand$inputOptions$2.parse(diffuse.kt:77)
	at com.jakewharton.diffuse.DiffCommand.run(diffuse.kt:133)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:139)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:14)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:215)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:212)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:230)
	at com.jakewharton.diffuse.Diffuse.main(diffuse.kt:40)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
JakeWhartoncommented, Nov 19, 2019

Unfortunately, due to a bug/missing feature in Java’s implementation of zip filesystems, you have to use Java 11 or newer for aars or aabs.

3reactions
JakeWhartoncommented, Sep 2, 2020

For posterity:

$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)

$ java -jar diffuse/build/libs/diffuse-0.2.0-SNAPSHOT-binary.jar diff --aar ~/Downloads/threetenabp-1.2.3.aar ~/Downloads/threetenabp-1.2.4.aar
OLD: threetenabp-1.2.3.aar
NEW: threetenabp-1.2.4.aar

 AAR      β”‚ old       β”‚ new     β”‚ diff
──────────┼───────────┼─────────┼────────
      jar β”‚   1.9 KiB β”‚ 1.9 KiB β”‚    0 B
 manifest β”‚     230 B β”‚   230 B β”‚    0 B
    other β”‚     457 B β”‚   457 B β”‚    0 B
──────────┼───────────┼─────────┼────────
    total β”‚ 102.8 KiB β”‚ 103 KiB β”‚ +202 B


 JAR     β”‚ old β”‚ new β”‚ diff
─────────┼─────┼─────┼───────────
 classes β”‚   2 β”‚   2 β”‚ 0 (+0 -0)
 methods β”‚  22 β”‚  22 β”‚ 0 (+0 -0)
  fields β”‚   3 β”‚   3 β”‚ 0 (+0 -0)


=================
====   AAR   ====
=================

 size      β”‚ diff   β”‚ path
───────────┼────────┼───────────────────────────────────
 100.4 KiB β”‚ +202 B β”‚ βˆ† assets/org/threeten/bp/TZDB.dat
───────────┼────────┼───────────────────────────────────
 100.4 KiB β”‚ +202 B β”‚ (total)

$ ~/Downloads/zulu11.2.3-jdk11.0.1-macosx_x64/bin/java -version
openjdk version "11.0.1" 2018-10-16 LTS
OpenJDK Runtime Environment Zulu11.2+3 (build 11.0.1+13-LTS)
OpenJDK 64-Bit Server VM Zulu11.2+3 (build 11.0.1+13-LTS, mixed mode)

$ ~/Downloads/zulu11.2.3-jdk11.0.1-macosx_x64/bin/java -jar diffuse/build/libs/diffuse-0.2.0-SNAPSHOT-binary.jar diff --aar ~/Downloads/threetenabp-1.2.3.aar ~/Downloads/threetenabp-1.2.4.aar
Exception in thread "main" java.nio.file.ProviderNotFoundException: Provider not found
	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:430)
	at com.jakewharton.diffuse.io.PathInput.toZip(Input.kt:24)
	at com.jakewharton.diffuse.format.Jar$Companion.parse(Jar.kt:1)
	at com.jakewharton.diffuse.format.Aar$Companion.parse(Aar.kt:4)
	at com.jakewharton.diffuse.DiffCommand.run(diffuse.kt:83)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:2095)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:2201)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:408)
	at com.jakewharton.diffuse.Diffuse.main(diffuse.kt:23453)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Direct local .aar file dependencies are not supported
I recently encountered the same issue, the fix was to remove the library from libs/ and import it using File -> New ->...
Read more >
Create an Android library - Android Developers
When you want to build the AAR file, select the library module in the Project window and then click Build > Build APK....
Read more >
Flutter Programming with Android AAR File - Dynamsoft
I was curious about how Flutter performs comparing to Xamarin and Cordova, and thus, I got started with Flutter a week ago. When...
Read more >
Building your own Android library - CodePath Cliffnotes
An .aar file can include the following types of files: ... When you create a new Android project, a new application is always...
Read more >
Problem updating AAR files to new version - Google Groups
So I recently updated Blockly Android on Android Studio with the latest git release. The project compiles and runs fine. When I generate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found