expo-dynamic-app-icon icon indicating copy to clipboard operation
expo-dynamic-app-icon copied to clipboard

Expo SDK 50 & Android deep link fix

Open simonsturge opened this issue 1 year ago • 32 comments

Updating android build.gradle to match one of a newly created module, which allows for building with Expo SDK 50.

I'm unsure if any other changes are required, however, I have tested in my own project using SDK 50, and I can confirm it works for me.

simonsturge avatar Feb 24 '24 14:02 simonsturge

Can also confirm this PR fixes my android build issue on SDK 50.

adamhari avatar Mar 01 '24 20:03 adamhari

I have modified the android plugin to take the intent filters from the main activity, instead of just creating the main intent filter. This copies any custom url schemas and share intents into the new activity aliases.

If any other plugins modify the main activity intent filters, we need to ensure that this plugin is listed FIRST in the plugins array.

simonsturge avatar Mar 16 '24 00:03 simonsturge

Closes #15 as well

apokusin avatar Mar 18 '24 11:03 apokusin

anyone know why this package dosent work on android anymore? Expo SDK 50, it works fine on iOS

Elue-dev avatar Mar 31 '24 22:03 Elue-dev

@outsung Please merge this

theblondealex avatar Apr 09 '24 16:04 theblondealex

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

theblondealex avatar Apr 09 '24 16:04 theblondealex

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",

Please do your own testing as I have modified a few things in this PR.

I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

simonsturge avatar Apr 09 '24 16:04 simonsturge

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",

Please do your own testing as I have modified a few things in this PR.

I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

please does this library now work properly for android? android build still fails for my app, using Expo SDK 50

Elue-dev avatar Apr 09 '24 16:04 Elue-dev

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",

Please do your own testing as I have modified a few things in this PR.

I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

Thank you, wasnt sure how to link it, will try this and test it myself and update, appreciate the switft reply and help

theblondealex avatar Apr 09 '24 16:04 theblondealex

please does this library now work properly for android? android build still fails for my app, using Expo SDK 50

are you building using my fork? I'm using expo 50.0.14 and android builds ok for me. if you're referring to the 'platform' prop I have added, this is optional if you only intend to use it for one platform, like myself.

Thank you, wasnt sure how to link it, will try this and test it myself and update, appreciate the switft reply and help

np. hope it works

simonsturge avatar Apr 09 '24 16:04 simonsturge

please does this library now work properly for android? android build still fails for my app, using Expo SDK 50

are you building using my fork? I'm using expo 50.0.14 and android builds ok for me. if you're referring to the 'platform' prop I have added, this is optional if you only intend to use it for one platform, like myself.

Thank you, wasnt sure how to link it, will try this and test it myself and update, appreciate the switft reply and help

np. hope it works

thanks for the response, sorry i’m not sure what you mean by ā€œbuilding using my forkā€, can you help shed more light? thanks

Elue-dev avatar Apr 09 '24 16:04 Elue-dev

thanks for the response, sorry i’m not sure what you mean by ā€œbuilding using my forkā€, can you help shed more light? thanks

until this PR is merged, in your package.json, use my fork as the source instead

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon"

simonsturge avatar Apr 09 '24 16:04 simonsturge

This worked for a dev build, (whicH failed before) so im sure itll work for a prod build thanks so much

theblondealex avatar Apr 12 '24 21:04 theblondealex

when will this be merged?!

Elue-dev avatar Apr 12 '24 21:04 Elue-dev

it may not be and @outsung has no obligation to, the kindness of @simonsturge means its still usable, as they mentioned you can just use it in our project with this

until this PR is merged, in your package.json, use my fork as the source instead

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon"

theblondealex avatar Apr 12 '24 21:04 theblondealex

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",

Please do your own testing as I have modified a few things in this PR.

I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

I tried "expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon" but getting CommandError: Failed to resolve plugin for module "expo-dynamic-app-icon" relative to "D:\Sanshu\fintech-clone-react-native" while running npx expo run:android

SunlightLuck avatar Apr 22 '24 22:04 SunlightLuck

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon", Please do your own testing as I have modified a few things in this PR. I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

I tried "expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon" but getting CommandError: Failed to resolve plugin for module "expo-dynamic-app-icon" relative to "D:\Sanshu\fintech-clone-react-native" while running npx expo run:android

"expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0",

This will pin it to a specific commit, which is preferred given this isn't an npm package with proper semver.

Reference material

apokusin avatar Apr 22 '24 22:04 apokusin

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon", Please do your own testing as I have modified a few things in this PR. I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[
        "expo-dynamic-app-icon",
        {
          "light": {
            "image": "./src/assets/icons/icon_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          },
          "dark": {
            "image": "./src/assets/icons/icon_dark_1024x1024.png",
            "prerendered": true,
            "platforms": ["ios"]
          }
        }
      ],

I tried "expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon" but getting CommandError: Failed to resolve plugin for module "expo-dynamic-app-icon" relative to "D:\Sanshu\fintech-clone-react-native" while running npx expo run:android

"expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0",

This will pin it to a specific commit, which is preferred given this isn't an npm package with proper semver.

Reference material

thanks for your comment, I updated my package.json with "expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0" but getting this error while installing node_modules C:\Users\Admin\AppData\Local\Yarn\Cache\v6\.tmp\cae3bc88f569b1a500984b83f06a3fd1.acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0.prepare\node_modules\expo-module-scripts\bin\expo-module-prepare:3 SyntaxError: Unexpected identifier

SunlightLuck avatar Apr 22 '24 23:04 SunlightLuck

thanks for your comment, I updated my package.json with "expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0"

but getting this error while installing node_modules

C:\Users\Admin\AppData\Local\Yarn\Cache\v6\.tmp\cae3bc88f569b1a500984b83f06a3fd1.acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0.prepare\node_modules\expo-module-scripts\bin\expo-module-prepare:3

SyntaxError: Unexpected identifier

Hard to say without the full log.

First try 'yarn cache clean' and try install again.

Otherwise try deleting 'node_modules' and then 'yarn install' and 'npx pod-install'.

If it keeps happening I'd search for the error on Google as it seems environment-specific.

apokusin avatar Apr 23 '24 00:04 apokusin

can anyone help with how to add this into a project for EAS Build, whenn running eas build it grabs the package from NPM and as such the main package not this fork, how do I point it to this forked patch so I can build for android?

"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",

Please do your own testing as I have modified a few things in this PR.

I have added a new 'platforms' prop that can be provided in the config setup. I personally did not want Android support as I wanted to use adaptive icons instead. usage as follows:

[

    "expo-dynamic-app-icon",
    {
      "light": {
        "image": "./src/assets/icons/icon_1024x1024.png",
        "prerendered": true,
        "platforms": ["ios"]
      },
      "dark": {
        "image": "./src/assets/icons/icon_dark_1024x1024.png",
        "prerendered": true,
        "platforms": ["ios"]
      }
    }
  ],

I tried "expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon" but getting CommandError: Failed to resolve plugin for module "expo-dynamic-app-icon" relative to "D:\Sanshu\fintech-clone-react-native" while running npx expo run:android

"expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0",

This will pin it to a specific commit, which is preferred given this isn't an npm package with proper semver.

Reference material

thanks for your comment, I updated my package.json with "expo-dynamic-app-icon": "git+https://github.com/simonsturge/expo-dynamic-app-icon#acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0" but getting this error while installing node_modules C:\Users\Admin\AppData\Local\Yarn\Cache\v6\.tmp\cae3bc88f569b1a500984b83f06a3fd1.acfd73827573e99a5e1bfbe47cf2fb1656e9ccf0.prepare\node_modules\expo-module-scripts\bin\expo-module-prepare:3 SyntaxError: Unexpected identifier

Hard to say without the full log.

First try 'yarn cache clean' and try install again.

Otherwise try deleting 'node_modules' and then 'yarn install' and 'npx pod-install'.

If it keeps happening I'd search for the error on Google as it seems environment-specific.

Tried to remove cache, node_modules and installed again, still get the same error. image

SunlightLuck avatar Apr 23 '24 04:04 SunlightLuck

Tried to remove cache, node_modules and installed again, still get the same error. image

Unfortunately I don't have the bandwidth to troubleshoot this issue.

However this issue seems related #21

apokusin avatar Apr 23 '24 04:04 apokusin

@outsung It'd be great to get this merged. Completely blocked from using this lib on android due to the Java 11 dependency this introduces.

beau6183 avatar Jun 13 '24 19:06 beau6183

@outsung It'd be great to get this merged. Completely blocked from using this lib on android due to the Java 11 dependency this introduces.

You can use the fork with these fixes mentioned here

apokusin avatar Jun 13 '24 19:06 apokusin

@simonsturge im using this pr to be able to build android, i noticed that when ever i change the icon it ceate new lunch icon on device home screen, for IOS is correct, it happens for you this behaviour?

kouloughli-hemza avatar Jun 18 '24 18:06 kouloughli-hemza

@simonsturge im using this pr to be able to build android, i noticed that when ever i change the icon it ceate new lunch icon on device home screen, for IOS is correct, it happens for you this behaviour?

this happened to me too, i ended up not using the library, probably when its more stable for android

Elue-dev avatar Jun 21 '24 08:06 Elue-dev

@simonsturge im using this pr to be able to build android, i noticed that when ever i change the icon it ceate new lunch icon on device home screen, for IOS is correct, it happens for you this behaviour?

this happened to me too, i ended up not using the library, probably when its not stable for android

did you manage to get dynamic icons working on android via another solution?

crumb1e avatar Jul 08 '24 15:07 crumb1e

@simonsturge im using this pr to be able to build android, i noticed that when ever i change the icon it ceate new lunch icon on device home screen, for IOS is correct, it happens for you this behaviour?

this happened to me too, i ended up not using the library, probably when its not stable for android

did you manage to get dynamic icons working on android via another solution?

Not really, still have issue of duplicate icon

kouloughli-hemza avatar Jul 08 '24 17:07 kouloughli-hemza

expo-dynamic-app-icon-npm-1.2.0-66d634aad7.patch

This yarn berry patch works for me

Wilson-Lim avatar Sep 02 '24 07:09 Wilson-Lim

seems like this is not working anymore @simonsturge do you have same issue? was working fine , now it's gives same gradle error

i updated few things on package to make build possible on Android, and published to npm

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

kouloughli-hemza avatar Sep 12 '24 14:09 kouloughli-hemza

@kouloughli-hemza Thanks for your fork! On android the size doesn't fill up the entire screen (addressing this issue: https://github.com/outsung/expo-dynamic-app-icon/issues/3)

thedev132 avatar Sep 15 '24 21:09 thedev132