Java Question Attribute "fontProviderFetchStrategy" already defined with incompatible format.

DonManfred

Expert
Licensed User
I am building a wrap for Tapkey.

Getting help from Erel i was able to come further in this but then i needed to add some more dependencies.

Namely
B4X:
#AdditionalJar: Tapkey.MobileLib-1.15.12.0.aar
#AdditionalJar: TapKey2.jar
#AdditionalJar: gson-2.8.5.jar
#AdditionalJar: Tapkey.SharedLib-1.15.12.0.aar
#AdditionalJar: auth0-1.15.1.aar
#AdditionalJar: okhttp-2.7.5.jar
#AdditionalJar: okio-1.11.0.jar
#AdditionalJar: androidx.core:core
#AdditionalJar: androidx.lifecycle:lifecycle-viewmodel
I now ran into new errors.

B4A Version: 9.01.2
Java Version: 11
Parsing code. (0.00s)
Building folders structure. (0.01s)
Compiling code. (0.01s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:36: error: Attribute "fontProviderFetchStrategy" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:42: Original attribute defined here.

e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:51: error: Attribute "fontProviderFetchTimeout" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:54: Original attribute defined here.

e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:61: error: Attribute "fontStyle" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:62: Original attribute defined here.

E:\Android\tools\..\extras\b4a_local\unpacked-auth0-1.15.1-63693366686862\res\layout\com_auth0_activity_web_auth.xml:38: error: Error: No resource found that matches the given name (at 'style' with value '@style/Widget.AppCompat.ProgressBar.Horizontal').
As far i can see it is because the Tapkey library is most probably using the Androidx Support-Libraries. Due to this i need to use them too (i read something similar in internet). There is also a guide for the Migration:
https://developer.android.com/jetpack/androidx/migrate

But i´m lost here as i don´t know what to do here to fix the problem.
 
Last edited:

DonManfred

Expert
Licensed User
Update:
It does not work. Even in the Testproject i get this error.

I tried to setup a new app two times.

It ends with this error:

B4A Version: 9.01.2
Java Version: 11
Parsing code. (0.00s)
Building folders structure. (0.01s)
Compiling code. (0.01s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
e:\android\tools\..\extras\b4a_remote\com\android\support\coordinatorlayout\28.0.0\unpacked-coordinatorlayout-28.0.0\res\values\values.xml:28: error: Attribute "layout_anchorGravity" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\coordinatorlayout\coordinatorlayout\1.0.0\unpacked-coordinatorlayout-1.0.0\res\values\values.xml:30: Original attribute defined here.
e:\android\tools\..\extras\b4a_remote\com\android\support\coordinatorlayout\28.0.0\unpacked-coordinatorlayout-28.0.0\res\values\values.xml:67: error: Attribute "layout_insetEdge" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\coordinatorlayout\coordinatorlayout\1.0.0\unpacked-coordinatorlayout-1.0.0\res\values\values.xml:67: Original attribute defined here.
e:\android\tools\..\extras\b4a_remote\com\android\support\coordinatorlayout\28.0.0\unpacked-coordinatorlayout-28.0.0\res\values\values.xml:84: error: Attribute "layout_dodgeInsetEdges" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\coordinatorlayout\coordinatorlayout\1.0.0\unpacked-coordinatorlayout-1.0.0\res\values\values.xml:86: Original attribute defined here.
e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:36: error: Attribute "fontProviderFetchStrategy" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:42: Original attribute defined here.
e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:51: error: Attribute "fontProviderFetchTimeout" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:54: Original attribute defined here.
e:\android\tools\..\extras\b4a_remote\com\android\support\support-compat\28.0.0\unpacked-support-compat-28.0.0\res\values\values.xml:61: error: Attribute "fontStyle" already defined with incompatible format.
e:\android\tools\..\extras\b4a_remote\androidx\core\core\1.0.2\unpacked-core-1.0.2\res\values\values.xml:62: Original attribute defined here.
What is your suggestion? How can i remove the dependencies to the old supportlibrary?
 

DonManfred

Expert
Licensed User
I tried to setup a new app two times.
i always added the tapkey code too.

I now setup a third blank project. I now added only the #addditionaljar lines and the manifest.

It compiles fine without an Error.
 

Attachments

DonManfred

Expert
Licensed User
You need to find it.
Probably it is this one which is referenced by Tapkey

http://central.maven.org/maven2/com/auth0/android/auth0/1.15.1/

The POM Content is:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="mozwebext">
<modelVersion>4.0.0</modelVersion>
<groupId>com.auth0.android</groupId>
<artifactId>auth0</artifactId>
<version>1.15.1</version>
<packaging>aar</packaging>
<name>Auth0.Android</name>
<description>Android toolkit for Auth0 API</description>
<url>https://github.com/auth0/Auth0.Android</url>
<developers>
<developer>
<id>auth0</id>
<name>Auth0</name>
<email>oss@auth0.com</email>
</developer>
<developer>
<id>lbalmaceda</id>
<name>Luciano Balmaceda</name>
<email>luciano.balmaceda@auth0.com</email>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>28.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>customtabs</artifactId>
<version>28.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
<version>2.7.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>logging-interceptor</artifactId>
<version>2.7.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.auth0.android</groupId>
<artifactId>jwtdecode</artifactId>
<version>1.1.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>https://raw.githubusercontent.com/auth0/Auth0.Android/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git@github.com:auth0/Auth0.Android.git</connection>
<developerConnection>scm:git@github.com:auth0/Auth0.Android.git</developerConnection>
<url>https://github.com/auth0/Auth0.Android</url>
</scm>
</project>
 

DonManfred

Expert
Licensed User
Make some tests and try to remove the dependencies
I downloaded the source, checked where any Resources are used, replaced all support to androidxsupport (Mappings), found out that it is mostly the WebAuthActivity which was adding the Supportlibrary due to AppCompat activity and some more.

In the code-flow one need to define the Webauth activity in Manifest and Tapkey will redirect to this activity.
While going over the source and editing it i realized that the problematic Activity is called due to an Manifestentry. I thinked over this and saw that i - probably - can easily replace this activity with an B4A Activity.

Finally i decided to remove the Auth0 WebAuthActivity and i´ll create an B4A Activity for the WebAuth (using Webview). Here i have all control over the webview that i need.
In Manifest i´ll set the webauth activity to be the b4a activity. Hope to get further this weekend. Today i´ll get the Test-Hardware provided by my customer.

I´ll update this thread - or maybe create a new one if i face another problem ;-).
Honestly i do have another problem related to references to okhttp inside the library. I´ll create a new thread for this.
 
Last edited:
Top