AppsFlyerSDK / appsflyer-capacitor-plugin

AppsFlyer SDK plugin for Capacitor
MIT License
13 stars 22 forks source link

Android No such file or directory #103

Closed sawaca96 closed 9 months ago

sawaca96 commented 10 months ago

Report

Plugin Version

"appsflyer-capacitor-plugin": "~6.12.1",
"@capacitor/android": "^5.0.0",

On what Platform are you having the issue?

android

What did you do?

npx cap open android

npx cap sync android

Sync project with gradle files (android studio ->  file)

What did you expect to happen?

no error raised

What happened instead?

below error raised

A problem occurred evaluating project ':appsflyer-capacitor-plugin'.
> packages/mobile/android/../node_modules/appsflyer-capacitor-plugin/package.json (No such file or directory)

Please provide any other relevant information.

When I was using version~6.9.2, I had no problem, but when I modified the version to ~6.12.1 while doing capacitor5 migrate, I got this error.

sawaca96 commented 10 months ago

I think it's because of the monorepo.

https://github.com/AppsFlyerSDK/appsflyer-capacitor-plugin/blob/d70c1b717c5d4edd2a64a010c9b218c5419ab2b9/android/build.gradle#L4C5-L4C19

If you look at the function in the link above

function is looking for package.json in ../node_modules, but it's actually a monorepo, so I think it should be in ../../../node_modules.

sawaca96 commented 10 months ago

I make PR https://github.com/AppsFlyerSDK/appsflyer-capacitor-plugin/pull/104

check this please ๐Ÿ™

paulisch commented 10 months ago

In case you are using nx you can work your way around that using "nohoist" inside of the "workspaces" declaration in your global-level packages.json. There you can put the path to your app which moves the node_modules for this one from the global level to the workspace-level.

sawaca96 commented 10 months ago

O-ha....!

@paulisch Thanks๐Ÿ™ I will try

pazlavi commented 10 months ago

Hey @sawaca96 Can you please try this alpha version and let us know if it solves the issue for you?

npm install appsflyer-capacitor-plugin@6.12.1-alpha-monorepo
kpturner commented 9 months ago

I have the exact same problem so I will try version 6.12.1-alpha-monorepo

kpturner commented 9 months ago

That version worked fine thankyou

sawaca96 commented 9 months ago

I works me too thanks! ๐Ÿ˜„