Android Question [Solved]ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

GuyBooth

Active Member
Licensed User
Longtime User
Just rebuilt my computer and with a new B4A project am seeing the following error during compile:
B4X:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
Never seen this error before and my initial searches on the forum have not given me any clues.
Can anyone help me track this down?
 

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Yes to the first, no to the second - I'm not using the AVDs, just B4A with my tablet.

I'm guessing the problem is in my manifest.
It's not in the manifest.
One difference - I'm using the latest java version (jdk1.8.0_152.sdk)

It shows up when I add the Runtimepermissions library to the project (even if I don't use it), but if I switch from sdk24 to sdk27 in my manifest the problem goes away. Not sure if this is going to be a problem - will I need to use sdk24 (I have one device that is "stuck" at KitKat) or will I be able to use sdk27 for everything?
 
Last edited:
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
I reinstalled all the Android sdk. At the end of the install I received the message:

Warning: File C:\Users\Guy\.android\repositories.cfg could not be loaded. (I remember now that I received this message the first time I installed the sdks).

Is this a problem? When I look in that folder, there is no file called repositories.cfg.
The error message "ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font" is no longer appearing, but I'm not sure how significant the repositories.cfg is.
 
Last edited:
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Bad to worse?
Having reinstalled the SDKs again, still with the message "Warning: File C:\Users\Guy\.android\repositories.cfg could not be loaded.", I can compile a very simple app and the compile appears to be successful - however, on my device I am now seeing the message "App not installed. The package appears to be corrupt."
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Correct way to install the SDK

1. Tools - SDK Manager.
2. Download SDK. It will open the browser. You should download sdk-tools-windows.
3. Unzip it in a folder such as C:\Android
4. Set sdkmanager.bat in the SDK manager tool. It will be in: C:\Android\tools\bin\sdkmanager.bat
5. The recommended items will be checked. Click on Install Selected.
6. Yes and No buttons will appear from time to time when you need to accept licenses. Read and accept.
7. Configure the IDE to use the new SDK. Tools - Configure Paths. Set the path to android.jar. It will be:
C:\Android\platforms\android-27\android.jar

If you are using B4A <7.8 then you should follow https://www.b4x.com/android/forum/t...-versions-of-android-tools.80090/#post-507157
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Correct way to install the SDK
Yes I know.
This doesn't tell me why I'm getting the "C:\Users\Guy\.android\repositories.cfg could not be loaded." message,
nor does it solve the "App not installed. The package appears to be corrupt." problem.
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
I'm going to assume that I have resolved the original issue in this thread, since I am no longer getting the error
B4X:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

I will open new threads to follow up on my other two issues.
 
Upvote 0

Krammig

Member
Licensed User
Longtime User
Guy, I am now seeing the same error ;

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

Do you know what it was that corrected this error ?

thanks
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Guy, I am now seeing the same error ;

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

Do you know what it was that corrected this error ?

thanks
Actually I'm not sure that I really did find the solution. When I switched to android:targetSdkVersion="27" instead of android:targetSdkVersion="24" the problem went away, and I have no reason to go back to 24.
Did you find a different solution?
Sorry I didn't post it when I first found this, I was having multiple issues to resolve all at once.
 
Upvote 0
Top