Closed mbiebl closed 2 years ago
@mbiebl while this may be by a bit easier now with v10. I understand that it may not be an option right now as it will use Material 3 and is a pre-release library.
On a first look things look good what you did.
I doubt it is working if you use:
<string name="library_cert4android_licenseId" translatable="false">gpl_3_0</string>
either?
Do you see the gpl
license being properly kept in the generated files for your app? Did you also ensure and try a clean build?
@mbiebl while this may be by a bit easier now with v10. I understand that it may not be an option right now as it will use Material 3 and is a pre-release library.
Yeah, unfortunately that is not really an option atm, so I would prefer if we can find a fix for 8.x
I doubt it is working if you use:
<string name="library_cert4android_licenseId" translatable="false">gpl_3_0</string>
either?
I tried that, but this didn't help.
Do you see the
gpl
license being properly kept in the generated files for your app? Did you also ensure and try a clean build?
I usually do a clean rebuild (tried even git clean -xdf), but that didn't make a difference.
Looking at the generated .apk, I see
So no gpl_3_0.txt there
I analyzed an older version of my app (from May 2020, using AboutLibraries 7.1.0), where this still worked and I see
$ ./gradlew exportLibraries
> Task :app:exportLibraries
Manually requested license: gpl_3_0
All dependencies.size=139
--> Retrieved POM for: com_google_code_findbugs__jsr305 from org.sonatype.oss:oss-parent:7
--> Retrieved POM for: org_apache_commons__commons_collections4 from org.apache.commons:commons-parent:47
Could not get the name for androidx_databinding__viewbinding, Using androidx.databinding:viewbinding
--> Retrieved POM for: org_ogce__xpp3 from org.sonatype.oss:oss-parent:7
--> Retrieved POM for: com_googlecode_ez_vcard__ez_vcard from org.sonatype.oss:oss-parent:7
Could not get the name for jakarta_regexp__jakarta_regexp, Using jakarta-regexp:jakarta-regexp
--> Retrieved POM for: org_apache_commons__commons_lang3 from org.apache.commons:commons-parent:47
--> Retrieved POM for: com_fasterxml_jackson_core__jackson_core from com.fasterxml.jackson:jackson-base:2.12.5
--> Retrieved POM for: com_github_mangstadt__vinnie from org.sonatype.oss:oss-parent:7
Could not get the name for androidx_databinding__databinding_adapters, Using androidx.databinding:databinding-adapters
Could not get the name for androidx_databinding__databinding_runtime, Using androidx.databinding:databinding-runtime
--> Retrieved POM for: org_brotli__dec from org.brotli:parent:0.1.2
----> Had to fallback to parent authorWebsite for: org_brotli__dec -- result: https://github.com/google
----> Had to fallback to parent description for: org_brotli__dec
----> Found license from parent for: org_brotli__dec -- result: MIT
Could not get the name for androidx_databinding__databinding_ktx, Using androidx.databinding:databinding-ktx
--> Retrieved POM for: com_google_guava__listenablefuture from com.google.guava:guava-parent:26.0-android
----> Had to fallback to parent author for: com_google_guava__listenablefuture -- result: Kevin Bourrillion
----> Had to fallback to parent authorWebsite for: com_google_guava__listenablefuture -- result: http://www.google.com
----> Found license from parent for: com_google_guava__listenablefuture -- result: Apache_2_0
--> Retrieved POM for: com_fasterxml_jackson__jackson_bom from com.fasterxml.jackson:jackson-parent:2.12
--> Retrieved POM for: commons_io__commons_io from org.apache.commons:commons-parent:42
--> Retrieved POM for: org_hamcrest__hamcrest_integration from org.hamcrest:hamcrest-parent:1.3
----> Had to fallback to parent author for: org_hamcrest__hamcrest_integration -- result: Joe Walnes, Nat Pryce, Steve Freeman, Neil Dunn, Tom Denley
----> Had to fallback to parent version for: org_hamcrest__hamcrest_integration -- result: 1.3
----> Found license from parent for: org_hamcrest__hamcrest_integration -- result: BSD_3_Clause
--> Had to resolve name from custom mapping for: androidx_savedstate__savedstate as SavedState
--> Retrieved POM for: com_squareup__javawriter from org.sonatype.oss:oss-parent:7
--> Had to resolve author from custom mapping for: com_squareup_okio__okio as Square, Inc
--> Retrieved POM for: org_apache_commons__commons_text from org.apache.commons:commons-parent:45
LIBRARIES:
okhttp;com.squareup.okhttp3:okhttp:4.9.1;[Apache_2_0]
Android Arch-Runtime;androidx.arch.core:core-runtime:2.1.0;[Apache_2_0]
Core Kotlin Extensions;androidx.core:core-ktx:1.7.0;[Apache_2_0]
FindBugs-jsr305;com.google.code.findbugs:jsr305:3.0.2;[Apache_2_0]
Hamcrest Core;org.hamcrest:hamcrest-core:2.2;[BSD_3_Clause]
AndroidX Futures;androidx.concurrent:concurrent-futures:1.0.0;[Apache_2_0]
Apache Commons Collections;org.apache.commons:commons-collections4:4.2;[]
Support fragment;androidx.fragment:fragment:1.4.0;[Apache_2_0]
dnsjava;dnsjava:dnsjava:2.1.9;[BSD_2_Clause]
androidx.databinding:viewbinding;androidx.databinding:viewbinding:7.0.4;[Apache_2_0]
Android Preferences KTX;androidx.preference:preference-ktx:1.1.1;[Apache_2_0]
Support core utils;androidx.legacy:legacy-support-core-utils:1.0.0;[Apache_2_0]
Android Lifecycle ViewModel Kotlin Extensions;androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0;[Apache_2_0]
Hamcrest Library;org.hamcrest:hamcrest-library:2.2;[BSD_3_Clause]
Android Lifecycle Process;androidx.lifecycle:lifecycle-process:2.4.0;[Apache_2_0]
AndroidX Test Library;androidx.test.espresso:espresso-idling-resource:3.4.0;[Apache_2_0]
colorpicker;com.jaredrummler:colorpicker:1.1.0;[Apache_2_0]
Android Navigation Runtime Kotlin Extensions;androidx.navigation:navigation-runtime-ktx:2.3.5;[Apache_2_0]
mockwebserver;com.squareup.okhttp3:mockwebserver:4.9.1;[Apache_2_0]
Android Room-Common;androidx.room:room-common:2.4.0-rc01;[Apache_2_0]
Kotlin Stdlib Common;org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10;[Apache_2_0]
Support VectorDrawable;androidx.vectordrawable:vectordrawable:1.1.0;[Apache_2_0]
Activity;androidx.activity:activity:1.2.4;[Apache_2_0]
Android Lifecycle ViewModel with SavedState;androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1;[Apache_2_0]
Android Emoji2 Compat;androidx.emoji2:emoji2:1.0.0;[Apache_2_0]
AndroidX Test Library;androidx.test.ext:junit:1.1.3;[Apache_2_0]
Android Navigation Fragment;androidx.navigation:navigation-fragment:2.3.5;[Apache_2_0]
JUnit;junit:junit:4.13.2;[EPL_1_0]
Fragment Kotlin Extensions;androidx.fragment:fragment-ktx:1.4.0;[Apache_2_0]
Experimental annotation;androidx.annotation:annotation-experimental:1.1.0;[Apache_2_0]
Android Paging-Common Kotlin Extensions;androidx.paging:paging-common-ktx:3.1.0;[Apache_2_0]
XPP3;org.ogce:xpp3:1.1.6;[Apache_2_0]
Support Cursor Adapter;androidx.cursoradapter:cursoradapter:1.0.0;[Apache_2_0]
Android ConstraintLayout Core;androidx.constraintlayout:constraintlayout-core:1.0.2;[Apache_2_0]
AndroidX Test Library;androidx.test.services:storage:1.4.0;[Apache_2_0]
Support Custom View;androidx.swiperefreshlayout:swiperefreshlayout:1.1.0;[Apache_2_0]
okhttp-logging-interceptor;com.squareup.okhttp3:logging-interceptor:4.9.1;[Apache_2_0]
ez-vcard;com.googlecode.ez-vcard:ez-vcard:0.11.3;[FreeBSD License]
Android DB;androidx.sqlite:sqlite:2.2.0-rc01;[Apache_2_0]
jakarta-regexp:jakarta-regexp;jakarta-regexp:jakarta-regexp:1.4;[]
AndroidX Test Library;androidx.test:rules:1.4.0;[Apache_2_0]
Support Custom View;androidx.customview:customview:1.0.0;[Apache_2_0]
Support Annotations;androidx.annotation:annotation:1.3.0;[Apache_2_0]
Android Room-Runtime;androidx.room:room-runtime:2.4.0-rc01;[Apache_2_0]
Support View Pager;androidx.viewpager:viewpager:1.0.0;[Apache_2_0]
javax.inject;javax.inject:javax.inject:1;[Apache_2_0]
AndroidX Test Library;androidx.test.espresso:espresso-core:3.4.0;[Apache_2_0]
Android Arch-Common;androidx.arch.core:core-common:2.1.0;[Apache_2_0]
Android Lifecycle ViewModel;androidx.lifecycle:lifecycle-viewmodel:2.4.0;[Apache_2_0]
Apache Commons Lang;org.apache.commons:commons-lang3:3.8.1;[]
Jackson-core;com.fasterxml.jackson.core:jackson-core:2.12.5;[Apache_2_0]
AndroidX Security;androidx.security:security-crypto:1.1.0-alpha03;[Apache_2_0]
Android Lifecycle LiveData Core;androidx.lifecycle:lifecycle-livedata-core:2.4.0;[Apache_2_0]
AndroidX Test Library;androidx.test:monitor:1.4.0;[Apache_2_0]
Support Interpolators;androidx.interpolator:interpolator:1.0.0;[Apache_2_0]
vinnie;com.github.mangstadt:vinnie:2.0.2;[MIT]
Android Paging-Runtime Kotlin Extensions;androidx.paging:paging-runtime-ktx:3.1.0;[Apache_2_0]
Android Navigation Runtime;androidx.navigation:navigation-runtime:2.3.5;[Apache_2_0]
bitfireAT/dav4jvm;com.github.bitfireAT:dav4jvm:fe62f70;[MPL_2_0]
VersionedParcelable;androidx.versionedparcelable:versionedparcelable:1.1.1;[Apache_2_0]
Support Local Broadcast Manager;androidx.localbroadcastmanager:localbroadcastmanager:1.0.0;[Apache_2_0]
AboutLibraries Library;com.mikepenz:aboutlibraries-core:8.9.1;[Apache_2_0]
Support Coordinator Layout;androidx.coordinatorlayout:coordinatorlayout:1.1.0;[Apache_2_0]
Support SQLite - Framework Implementation;androidx.sqlite:sqlite-framework:2.2.0-rc01;[Apache_2_0]
LiveData Core Kotlin Extensions;androidx.lifecycle:lifecycle-livedata-core-ktx:2.3.1;[Apache_2_0]
Android Room Migration;androidx.room:room-migration:2.4.0-rc01;[Apache_2_0]
androidx.databinding:databinding-adapters;androidx.databinding:databinding-adapters:7.0.4;[Apache_2_0]
androidx.databinding:databinding-runtime;androidx.databinding:databinding-runtime:7.0.4;[Apache_2_0]
AndroidX Test Library;androidx.test:runner:1.4.0;[Apache_2_0]
Kotlin Stdlib Jdk7;org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10;[Apache_2_0]
kotlinx-coroutines-core;org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2;[Apache_2_0]
Android Paging-Runtime;androidx.paging:paging-runtime:3.1.0;[Apache_2_0]
Kotlin Stdlib Jdk8;org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30;[Apache_2_0]
Android Resource Inspection - Annotations;androidx.resourceinspection:resourceinspection-annotation:1.0.0;[Apache_2_0]
${project.groupId}:${project.artifactId};org.brotli:dec:0.1.2;[MIT]
Android Transition Support Library;androidx.transition:transition:1.2.0;[Apache_2_0]
Android Lifecycle-Common;androidx.lifecycle:lifecycle-common:2.4.0;[Apache_2_0]
Support Drawer Layout;androidx.drawerlayout:drawerlayout:1.0.0;[Apache_2_0]
Android Navigation Fragment Kotlin Extensions;androidx.navigation:navigation-fragment-ktx:2.3.5;[Apache_2_0]
Android Room Testing;androidx.room:room-testing:2.4.0-rc01;[Apache_2_0]
androidx.databinding:databinding-ktx;androidx.databinding:databinding-ktx:7.0.4;[Apache_2_0]
Android Navigation Common Kotlin Extensions;androidx.navigation:navigation-common-ktx:2.3.5;[Apache_2_0]
Support collections;androidx.collection:collection:1.1.0;[Apache_2_0]
Android App Startup Runtime;androidx.startup:startup-runtime:1.0.0;[Apache_2_0]
Kotlin Stdlib;org.jetbrains.kotlin:kotlin-stdlib:1.6.10;[Apache_2_0]
Guava ListenableFuture only;com.google.guava:listenablefuture:1.0;[Apache_2_0]
Support RecyclerView;androidx.recyclerview:recyclerview:1.2.1;[Apache_2_0]
Support Custom Tabs;androidx.browser:browser:1.4.0;[Apache_2_0]
AppIntro;com.github.AppIntro:AppIntro:6.1.0;[Apache_2_0]
okhttp-brotli;com.squareup.okhttp3:okhttp-brotli:4.9.1;[Apache_2_0]
Activity Kotlin Extensions;androidx.activity:activity-ktx:1.2.3;[Apache_2_0]
kotlinx-coroutines-core;org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.2;[Apache_2_0]
Room Paging;androidx.room:room-paging:2.4.0-rc01;[Apache_2_0]
Android ConstraintLayout;androidx.constraintlayout:constraintlayout:2.1.2;[Apache_2_0]
Accessibility Test Framework;com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:3.1;[Apache_2_0]
Android Room Kotlin Extensions;androidx.room:room-ktx:2.4.0-rc01;[Apache_2_0]
AndroidX Test Library;androidx.test.ext:junit-ktx:1.1.3;[Apache_2_0]
Support Print;androidx.print:print:1.0.0;[Apache_2_0]
Android Lifecycle Service;androidx.lifecycle:lifecycle-service:2.2.0;[Apache_2_0]
Jackson BOM;com.fasterxml.jackson:jackson-bom:2.12.5;[Apache_2_0]
Tink Cryptography API for Android;com.google.crypto.tink:tink-android:1.5.0;[Apache_2_0]
AndroidX Preference;androidx.preference:preference:1.1.1;[Apache_2_0]
SavedState Kotlin Extensions;androidx.savedstate:savedstate-ktx:1.1.0;[Apache_2_0]
Apache Commons IO;commons-io:commons-io:2.6;[]
Support CardView v7;androidx.cardview:cardview:1.0.0;[Apache_2_0]
androidx.databinding.databinding-common;androidx.databinding:databinding-common:7.0.4;[Apache_2_0]
Android Emoji2 Compat view helpers;androidx.emoji2:emoji2-views-helper:1.0.0;[Apache_2_0]
Hamcrest Integration;org.hamcrest:hamcrest-integration:1.3;[BSD_3_Clause]
Support AnimatedVectorDrawable;androidx.vectordrawable:vectordrawable-animated:1.1.0;[Apache_2_0]
kotlinx-coroutines-android;org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2;[Apache_2_0]
Android Lifecycle LiveData;androidx.lifecycle:lifecycle-livedata:2.4.0;[Apache_2_0]
SavedState;androidx.savedstate:savedstate:1.1.0;[Apache_2_0]
AndroidX Test Library;androidx.test.espresso:espresso-contrib:3.4.0;[Apache_2_0]
Support compat;androidx.core:core:1.7.0;[Apache_2_0]
Android Lifecycle Runtime;androidx.lifecycle:lifecycle-runtime:2.4.0;[Apache_2_0]
Android Paging-Common;androidx.paging:paging-common:3.1.0;[Apache_2_0]
JavaWriter;com.squareup:javawriter:2.1.1;[Apache_2_0]
Collections Kotlin Extensions;androidx.collection:collection-ktx:1.1.0;[Apache_2_0]
Support loader;androidx.loader:loader:1.0.0;[Apache_2_0]
org.conscrypt:conscrypt-android;org.conscrypt:conscrypt-android:2.5.2;[Apache_2_0]
Android Navigation Common;androidx.navigation:navigation-common:2.3.5;[Apache_2_0]
Okio;com.squareup.okio:okio:2.8.0;[Apache_2_0]
Android Lifecycle Kotlin Extensions;androidx.lifecycle:lifecycle-runtime-ktx:2.3.1;[Apache_2_0]
Hamcrest;org.hamcrest:hamcrest:2.2;[BSD_3_Clause]
Support Document File;androidx.documentfile:documentfile:1.0.0;[Apache_2_0]
Android Resources Library;androidx.appcompat:appcompat-resources:1.4.0;[Apache_2_0]
FastAdapter Library;com.mikepenz:fastadapter:5.4.1;[Apache_2_0]
Support DynamicAnimation;androidx.dynamicanimation:dynamicanimation:1.0.0;[Apache_2_0]
Android Lifecycle Extensions;androidx.lifecycle:lifecycle-extensions:2.2.0;[Apache_2_0]
flexbox-layout;com.google.android.flexbox:flexbox:3.0.0;[Apache_2_0]
Material Components for Android;com.google.android.material:material:1.4.0;[Apache_2_0]
IntelliJ IDEA Annotations;org.jetbrains:annotations:13.0;[Apache_2_0]
Android Tracing;androidx.tracing:tracing:1.0.0;[Apache_2_0]
AndroidX Widget ViewPager2;androidx.viewpager2:viewpager2:1.0.0;[Apache_2_0]
Apache Commons Text;org.apache.commons:commons-text:1.3;[]
AndroidX Test Library;androidx.test:core:1.4.0;[Apache_2_0]
LiveData Kotlin Extensions;androidx.lifecycle:lifecycle-livedata-ktx:2.4.0;[Apache_2_0]
Android AppCompat Library;androidx.appcompat:appcompat:1.4.0;[Apache_2_0]
LICENSES:
EPL-1.0;Eclipse Public License 1.0;https://spdx.org/licenses/EPL-1.0.html
MPL-2.0;Mozilla Public License 2.0;https://spdx.org/licenses/MPL-2.0.html
MIT;MIT License;https://spdx.org/licenses/MIT.html
BSD-3-Clause;BSD 3-Clause "New" or "Revised" License;https://spdx.org/licenses/BSD-3-Clause.html
BSD-2-Clause;BSD 2-Clause "Simplified" License;https://spdx.org/licenses/BSD-2-Clause.html
Apache-2.0;Apache License 2.0;https://spdx.org/licenses/Apache-2.0.html
ARTIFACTS WITHOUT LICENSE:
UNKNOWN LICENSES:
FreeBSD License
-- [com.googlecode.ez-vcard:ez-vcard:0.11.3]
Tapping on a license name of a library using e.g. BSD-3-Clause or BSD-2-Clause opens the spdx license website instead of showing the license text directly.
Thank you for the additional details.
So it really looks like something with the additionalLicenses
config is off.
So it really looks like something with the
additionalLicenses
config is off.
"config" meaning something I didn't configure correctly?
I will look into it, sorry that I wasn't responding faster, but due to the end of the year trying to take a short break from programming as a mental refresh :)
Sorry for any inconvenience
Oh, don't worry, and sorry if I come across too pushy, this wasn't my intention. There is absolutely no hurry.
Oh I believe I see the problem. Most likely it's because the licenses SPDX identifier is called different:
(And the SPDX identifier is the one used to manually keep a license)
So you should define LGPL_3_0_only
or LGPL_3_0_or_later
as the additional license to keep, and use that same identifier for this dependency.
GPL 3.0
's license would need a few adjustments to show equal to the Apache 2.0 if that's what your usecase would need?
An alternative solution would be to copy paste over the xml
license_gpl_3_0_strings.xml
(from values) and license_gpl_3_0.txt
(from raw) manually to your project.
Find them here: https://github.com/mikepenz/AboutLibraries/tree/v8.9.4/aboutlibraries-definitions/src/main/res
An additional note to the licenses which are nut fully custom supported will load their license in the browser on the SPDX site instead of the popup you describe.
A general note, I believe we were able to significantly streamline these situations and the handling and unify the behaviour with 10.x so such problems should be a problem of the past, but always happy to improve further.
Thanks for the hint!
--- a/app/src/main/res/values/about_libraries.xml
+++ b/app/src/main/res/values/about_libraries.xml
@@ -18,7 +18,7 @@
<string name="library_cert4android_libraryVersion" translatable="false">68f51b8</string>
<string name="library_cert4android_repositoryLink" translatable="false">https://github.com/bitfireAT/cert4android</string>
<string name="library_cert4android_isOpenSource" translatable="false">true</string>
- <string name="library_cert4android_licenseIds" translatable="false">gpl_3_0</string>
+ <string name="library_cert4android_licenseIds" translatable="false">GPL_3_0_or_later</string>
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -88,7 +88,7 @@ aboutLibraries {
// DAVx5 is GPL 3.0 and not detected automatically.
// Since no other library uses GPL 3.0 we need to include it manually.
additionalLicenses {
- gpl_3_0
+ GPL_3_0_or_later
}
}
With this change, I get a proper license string and tapping on the license opens the spdx website. While the spdx license pages are apparenly not really designed for mobile devices and a bit hard to read due to the tiny fonts, what I have now works good enough I'd say. I'm a bit undecided, whether it's better to embed the license files or if simply referring to the spdx one is sufficient. But that's more of a general question, whether to ship internal copies of those license files or not.
What makes a lot of sense is using the license identifiers defined by spdx.org I think. What could be be nice is if there was a mapping between the "old" names like gpl_3_0
to the new names like GPL_3_0_or_later
so an existing about_libraries.xml
would just continue to work. On the other hand, updating about_libraries.xml
was simple enough, so maybe aboutlibraries could just log a build time warning if the old names are still used.
Glad it is working for you now.
Relevant on this note. 10.x will include a copy of the license text locally, but even go one step further by pulling (if configured) the original license file from GitHub if the project is hosted there.
The current approach for licenses (with the custom copy of them within the repo) is dropped with 10.x, so in the future that won't be applicable anymore.
With v10 on the horizon no more changes will be done to the current v8 brunch, but patches if bugs occur.
Thank you so much for the provided details, so I was able to help.
The current approach for licenses (with the custom copy of them within the repo) is dropped with 10.x, so in the future that won't be applicable anymore.
Nod, makes sense. Thanks for the heads up.
With v10 on the horizon no more changes will be done to the current v8 brunch, but patches if bugs occur.
Yeah, what I have now works fine enough.
Again, thanks a lot for your help.
Version: 8.9.4
In one of my projects, I include a third party library via a git submodule and wanted to add its library information to the about dialog. For that I created app/src/main/res/values/about_libraries.xml, containing
In app/build.gradle, I added
The resulting about info activity looks like this:
There are two issues here: