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

Expo SDK 50 & Android deep link fix #18

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

simonsturge
Copy link

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.

@adamhari
Copy link

adamhari commented Mar 1, 2024

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

@simonsturge simonsturge changed the title Update android build.gradle Expo SDK 50 & Android deep link fix Mar 16, 2024
@simonsturge
Copy link
Author

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.

@apokusin
Copy link

Closes #15 as well

Simon added 2 commits March 23, 2024 18:50
@Elue-dev
Copy link

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

@theblondealex
Copy link

@outsung Please merge this

@theblondealex
Copy link

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?

@simonsturge
Copy link
Author

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"]
          }
        }
      ],

@Elue-dev
Copy link

Elue-dev commented Apr 9, 2024

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

@theblondealex
Copy link

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

@simonsturge
Copy link
Author

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

@Elue-dev
Copy link

Elue-dev commented Apr 9, 2024

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

@simonsturge
Copy link
Author

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"

@theblondealex
Copy link

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

@Elue-dev
Copy link

when will this be merged?!

@theblondealex
Copy link

theblondealex commented Apr 12, 2024

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"

@SunlightLuck
Copy link

SunlightLuck commented Apr 22, 2024

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

@apokusin
Copy link

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

@SunlightLuck
Copy link

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

@apokusin
Copy link

apokusin commented Apr 23, 2024

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.

@SunlightLuck
Copy link

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

@apokusin
Copy link

apokusin commented Apr 23, 2024

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

@beau6183
Copy link

@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.

@apokusin
Copy link

@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

@kouloughli-hemza
Copy link

@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?

@Elue-dev
Copy link

Elue-dev commented Jun 21, 2024

@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

@crumb1e
Copy link

crumb1e commented Jul 8, 2024

@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?

@kouloughli-hemza
Copy link

@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

@Wilson-Lim
Copy link

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

This yarn berry patch works for me

@kouloughli-hemza
Copy link

kouloughli-hemza commented Sep 12, 2024

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

@thedev132
Copy link

@kouloughli-hemza Thanks for your fork! On android the size doesn't fill up the entire screen (addressing this issue: #3)

@kouloughli-hemza
Copy link

@kouloughli-hemza Thanks for your fork! On android the size doesn't fill up the entire screen (addressing this issue: #3)

@kouloughli-hemza Thanks for your fork! On android the size doesn't fill up the entire screen (addressing this issue: #3)

there few issues on Android that i plan to work on after vacation, such as Duplicate icon and this icon size.

@kouloughli-hemza
Copy link

you can try https://www.npmjs.com/package/nixa-expo-dynamic-app-icon new version for android duplicate icon issue

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

Successfully merging this pull request may close these issues.