Open frei-0xff opened 2 years ago
Hmm, this has been working for years, I wonder what has happened. Can you please help by checking if using the “-icon” parameter has the same result?
@andydotxyz Checked. Yes, it is the same with -icon
parameter.
Can you share the icon you are using? Is it certainly a PNG?
@andydotxyz Yes, of course it is. Here it is:
Tried with standard Fyne's icon with gray cogwheel with the same result.
I don't think it can depend on icon itself. As I already pointed out, the problem is in android:icon
attribute in AndroidManifest.xml. It has to be something like @mipmap/icon.png
but it is set to 0x7f020000
.
Edit:
As I'm looking into fyne's source, I see that it is set to value 0x7f020000
on purpose. I'm just not competent enough to understand how it is supposed to work and why it doesn't.
Edit2:
Maybe the problem in resources.arsc
file instead. I failed to decode it. Decoder returns error:
Error decode arsc
java.io.IOException: Expected entry start, expected offset: 0x258, actual: 0x268
at jadx.core.xmlgen.ParserStream.checkPos(ParserStream.java:124)
at jadx.core.xmlgen.ResTableParser.parseTypeChunk(ResTableParser.java:213)
at jadx.core.xmlgen.ResTableParser.parsePackage(ResTableParser.java:169)
at jadx.core.xmlgen.ResTableParser.decodeTableChunk(ResTableParser.java:118)
at jadx.core.xmlgen.ResTableParser.decode(ResTableParser.java:66)
at jadx.core.xmlgen.ResTableParser.decodeFiles(ResTableParser.java:71)
Hmm, this has been working for years, I wonder what has happened. Can you please help by checking if using the “-icon” parameter has the same result?
Hmm, I cannot replicate this at all. Can you please try packaging one of our provided apps and see if it installs as expected on your device?
Also what is the result printed for fyne version
?
@andydotxyz fyne cmd is the latest fyne cli version: v2.2.1
Is there any already packaged apk file that is known to show the right icon, so I can check it on my phone?
Maybe the problem is in old Android version on my device or something like that.
You could download one of the Fyne apps from the store? https://apps.fyne.io/playstore.html If you need to test a file directly best join one of our chat channels and someone can PM you one.
@andydotxyz Tried to install Calculator and FyneGameBoy. They both installed with the default green icon. And won't run at all. Thus, it is an incompatibility problem, probably because of old Android version 5.1.1 on my device.
Thanks for this. It should work on 5.1.1 though, I tested on 4.1. Is there anything helpful in the log when they crash and/or load perhaps relating to icon or otherwise.
@andydotxyz How can I see the log on Android phone?
Use adb logcat
@andydotxyz Sorry, I don't have Android SDK installed. I used fyne-cross containers for packaging apk.
I used fyne-cross containers for packaging apk.
Ah, this is crucial information. The fyne
version of your system is not relevant like I had thought. What version of fyne-cross
are you using?
@andydotxyz I understand that. As I said, I use the latest version for packaging. I use cross-fyne's container fyneio/fyne-cross:1.2-android
as environment for packaging. And before packaging I update fyne command to the latest version by go install fyne.io/fyne/v2/cmd/fyne@latest
I use cross-fyne's container fyneio/fyne-cross:1.2-android as environment for packaging
You are not using the fyne-cross command itself?
And before packaging I update fyne command to the latest version by go install fyne.io/fyne/v2/cmd/fyne@latest
Indeed, but this will not be used by fyne-cross, as it is bundled into the container images.
You are not using the fyne-cross command itself?
No, I'm running command fyne package -os android -release
inside Docker container fyneio/fyne-cross:1.2-android
that has preinstalled environment for building Android application.
It's just easier than installing all of that on my local computer.
Hmm, thanks.
Is this a standard Android device? What make/model is the 5.1.1 OS running on?
Is this a standard Android device? What make/model is the 5.1.1 OS running on?
Yes, it's Huawei GR5. It is quite old.
I am having the same issue. However, the App is falling back to the default icon only when I have an AndroidManifest.xml
and then run fyne package --os android --icon icon.png
. Without any AndroidManifest.xml
the icon just show sup correctly (but then I can't use the AndroidManifest.xml
to request/set app storage permissions).
When I try to manually set the icon in the AndroidManifest.xml
I get: "manual declaration of android:icon in AndroidManifest.xml not supported"
My manifest currently looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.buetow.quicklogger">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:label="quicklogger"
android:icon="icon">
<activity android:name="org.golang.app.GoNativeActivity">
<meta-data android:name="android.app.lib_name" android:value="npc" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
I am using:
fyne version v2.4.3
I am having the same issue. However, the App is falling back to the default icon only when I have an
AndroidManifest.xml
and then runfyne package --os android --icon icon.png
. Without anyAndroidManifest.xml
the icon just show sup correctly (but then I can't use theAndroidManifest.xml
to request/set app storage permissions).When I try to manually set the icon in the
AndroidManifest.xml
I get: "manual declaration of android:icon in AndroidManifest.xml not supported"My manifest currently looks like this:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.buetow.quicklogger"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <application android:allowBackup="true" android:label="quicklogger" android:icon="icon"> <activity android:name="org.golang.app.GoNativeActivity"> <meta-data android:name="android.app.lib_name" android:value="npc" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>
I am using:
fyne version v2.4.3
The icon reference will have to match the lookup generated in the compiled assets. I recommend generating an app without a custom manifest, then extracting it and making the changes you want, then running again. It should work.
Thanks, but that didn't work for me. When I extract the AndroidManifest.xml
from the apk file and use that one I get still "manual declaration of android:icon in AndroidManifest.xml not supported".
What worked however (app icon showing up) was to clone the fyne project, change the occurances of android.permission.INTERNET
to android.permission.MANAGE_EXTERNAL_STORAGE
(as these are all the changes I want in my custom android manifest) in the source tree, re-compile fyne. Now all works. I know, this is more of an hammer approach!
Updated the title to report the real issue. I think the solution may be to support generically adding permission /role requests in the app metadata which we can add to the platform specific formats when packaging.
Generic support for adding permissions in the app metadata would be good, indeed
Describe the bug:
Android application build by
fyne package -os android -release
installs with default green android icon and not the one set in FyneApp.toml After inspecting apk file I found out that icon's PNG is properly added to/res/mipmap-xxxhdpi-v4/icon.png
, but decoded AndroidManifest.xml looks like that:android:icon="0x7f020000"
does not seem right.To Reproduce:
Steps to reproduce the behaviour:
fyne package -os android -release
Screenshots:
Example code:
Device (please complete the following information):