Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing Java compatibility issues with Android, works fine in iOS #27

Open
Agnel1234 opened this issue Sep 10, 2024 · 11 comments
Open

Facing Java compatibility issues with Android, works fine in iOS #27

Agnel1234 opened this issue Sep 10, 2024 · 11 comments

Comments

@Agnel1234
Copy link

Agnel1234 commented Sep 10, 2024

On my Expo App, i am trying to incorporate this package to change the App Icon on runtime from the App Binary. It works perfectly fine in IOS, however for Android it is not working as expected coz of Java Compatible issue. Can you please help us here ?

@kouloughli-hemza
Copy link

Try my fork
https://www.npmjs.com/package/nixa-expo-dynamic-app-icon
it builds fine on Android

@Agnel1234
Copy link
Author

@kouloughli-hemza Thanks for sharing the fork npm package for the above issue. It really helps to solve the App icon issue on both IOS and Android together with the single package.

However, whenever i tried to do setAppIcon("icon3"), it creates duplicate instance of App on Android platform, it works perfectly fine on IOS though.

@RawaMustafa
Copy link

RawaMustafa commented Oct 27, 2024

there is any fix for duplicate app issue on android ..?

@kouloughli-hemza
Copy link

there is any fix for duplicate app issue on android ..?

Not yet, i have not tried to find solution

@kouloughli-hemza
Copy link

kouloughli-hemza commented Nov 22, 2024

@RawaMustafa @Agnel1234

https://www.npmjs.com/package/nixa-expo-dynamic-app-icon

you can try the new version to fix issue of duplicate icon on android

@arindambiswas1
Copy link

arindambiswas1 commented Jan 9, 2025

@kouloughli-hemza still getting issue on Android when building Android dev client, ios works fine, here is the log

Execution failed for task ':nixa-expo-dynamic-app-icon:compileDebugKotlin'.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

`

Task :nixa-expo-dynamic-app-icon:compileDebugKotlin FAILED
e: file:///C:node_modules/nixa-expo-dynamic-app-icon/android/src/main/java/expo/modules/dynamicappicon/ComponentUtils.kt:23:62 Unresolved reference: activityExists
e: file:///C:/node_modules/nixa-expo-dynamic-app-icon/android/src/main/java/expo/modules/dynamicappicon/ComponentUtils.kt:24:13 Unresolved reference: activityExists
e: file:///C:/node_modules/nixa-expo-dynamic-app-icon/android/src/main/java/expo/modules/dynamicappicon/ExpoDynamicAppIconModule.kt:80:23 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Array<(out) ActivityInfo!>?
`

@ddeveloper2023
Copy link

@kouloughli-hemza Your library is causing build errors in Expo 52 —could you fix it?

@arindambiswas1
Copy link

arindambiswas1 commented Feb 25, 2025

@kouloughli-hemza Your library is causing build errors in Expo 52 —could you fix it?

hi, after some Googling, I came across a package called @mozzius/expo-dynamic-app-icon (https://github.com/mozzius/expo-dynamic-app-icon), which the Bluesky app (https://github.com/bluesky-social/social-app) also uses. I tried it in my app, and it worked!
"expo": "~52.0.35", "@mozzius/expo-dynamic-app-icon": "^1.5.0" , "react-native": "0.76.7"

As of today the latest release of @mozzius/expo-dynamic-app-icon ^1.6.0 has some issues with config plugins so I used the 1.5.0 version

@kouloughli-hemza
Copy link

@kouloughli-hemza Your library is causing build errors in Expo 52 —could you fix it?

hi, after some Googling, I came across a package called @mozzius/expo-dynamic-app-icon (https://github.com/mozzius/expo-dynamic-app-icon), which the Bluesky app (https://github.com/bluesky-social/social-app) also uses. I tried it in my app, and it worked! "expo": "~52.0.35", "@mozzius/expo-dynamic-app-icon": "^1.5.0" , "react-native": "0.76.7"

As of today the latest release of @mozzius/expo-dynamic-app-icon ^1.6.0 has some issues with config plugins so I used the 1.5.0 version

Does it fix the issue of icon duplication on android?

@kouloughli-hemza
Copy link

@kouloughli-hemza Your library is causing build errors in Expo 52 —could you fix it?

hi, after some Googling, I came across a package called @mozzius/expo-dynamic-app-icon (https://github.com/mozzius/expo-dynamic-app-icon), which the Bluesky app (https://github.com/bluesky-social/social-app) also uses. I tried it in my app, and it worked! "expo": "~52.0.35", "@mozzius/expo-dynamic-app-icon": "^1.5.0" , "react-native": "0.76.7"

As of today the latest release of @mozzius/expo-dynamic-app-icon ^1.6.0 has some issues with config plugins so I used the 1.5.0 version

i see that it doesnt fix the issue :

if (isAndroid) {
const next =
sets.defaults.find(i => i.id === icon) ??
sets.core.find(i => i.id === icon)
Alert.alert(
next
? _(msgChange app icon to "${next.name}")
: _(msgChange app icon),
// to determine - can we stop this happening? -sfn
_(msgThe app will be restarted),
[
{
text: _(msgCancel),
style: 'cancel',
},
{
text: _(msgOK),
onPress: () => {
setCurrentAppIcon(setAppIcon(icon))
},
style: 'default',
},
],
)

see the code found on bluesky to handle android duplicate icon here , they restart the app. also changing app icon on Android breaks the aliases , so if you try to use share button for example app will crash .

@kouloughli-hemza
Copy link

@kouloughli-hemza Your library is causing build errors in Expo 52 —could you fix it?

sure i will try to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants