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

Build fail for capacitor v5 #126

Closed
vincentsartoko opened this issue May 11, 2024 · 4 comments
Closed

Build fail for capacitor v5 #126

vincentsartoko opened this issue May 11, 2024 · 4 comments
Labels
Support Please open a support ticket

Comments

@vincentsartoko
Copy link

Hi, when doing gradlew bundleRelease, it throws this error:

> Configure project :appsflyer-capacitor-plugin
could not found package.json from ENV variable
searching for package.json recursively
node_modules directory not found in any parent directories.

* What went wrong:
A problem occurred evaluating project ':appsflyer-capacitor-plugin'.

> Cannot get property 'androidSdkVersion' on null object
@vincentsartoko
Copy link
Author

Found the issue, when android file is not on the same directory as the frontend file, it will throw error due to file not found.

Maybe try to modify this line? node_modules/appsfluer-capacitor-plugin/android/build.gradle

String getPackageJsonPath() {
    return findProperty("APPSFLYER_PACKAGE_JSON") ?: "$rootDir/../node_modules/appsflyer-capacitor-plugin/package.json"
}

@pazlavi pazlavi added the Support Please open a support ticket label May 11, 2024
Copy link

👋 Hi @vincentsartoko and Thank you for reaching out to us.
In order for us to provide optimal support, please submit a ticket to our support team at support@appsflyer.com.
When submitting the ticket, please specify:

  • ✅ your AppsFlyer sign-up (account) email
  • ✅ app ID
  • ✅ production steps
  • ✅ logs
  • ✅ code snippets
  • ✅ and any additional relevant information.

@Dani-Koza-AF
Copy link
Collaborator

Dani-Koza-AF commented Oct 16, 2024

The goal of getPackageJsonPath() is to find the path to the package.json file in order to import the correct configuration for AppsFlyer's Android SDK. Thank you for your suggestion but locating build.gradle is not the goal so it's not a relevant modification.
I am working on a solution that will cover as much as possible paths for irregular project structures in order to fetch the package.json file, and it will be released next week.
If you wish, regardless of the new solution that will be introduced, you may easily add the property APPSFLYER_PACKAGE_JSON (which represents a string which is the path to package.json) to android/variables.gradle file amongst the various properties there, as recommended in the official Capacitor docs.

*APPSFLYER_PACKAGE_JSON will be changed to APPSFLYER_PACKAGE_JSON_PATH in next release

@Dani-Koza-AF
Copy link
Collaborator

New version v6.15.2 will be release tomorrow, with a improvements according to your request and another possible fallback solution will be described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Please open a support ticket
Projects
None yet
Development

No branches or pull requests

3 participants