adjust / cordova_sdk

This is the Cordova SDK of
http://www.adjust.com
Other
37 stars 43 forks source link

Installation fails and then XCode build fails #163

Closed nijakobius closed 1 year ago

nijakobius commented 2 years ago

Hi, trying to install this is in my project via cordova plugin add com.adjust.sdk, with the following result:

Installing "com.adjust.sdk" for android
(node:91701) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/myname/Documents/Projekte/appname/App/appname/platforms/android/cordova/node_modules/objectorarray/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
Subproject Path: CordovaLib
Subproject Path: app
Installing "com.adjust.sdk" for browser
(node:91701) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/myname/Documents/Projekte/appname/App/appname/node_modules/objectorarray/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
Installing "com.adjust.sdk" for ios
Failed to install 'com.adjust.sdk': Error: pod: Command failed with exit code ENOENT
    at ChildProcess.whenDone (/Users/myname/Documents/Projekte/appname/App/appname/node_modules/cordova-common/src/superspawn.js:136:25)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
pod: Command failed with exit code ENOENT

Afterwards, com.adjust.sdk 4.30.0 "Adjust" is shown in the list of plugins when running cordova plugin.

However, when I try to build the app in XCode, it fails with the following error message:

'Adjust.h' file not found

The error is in AdjustCordova.h and AdjustCordovaDelegate.h both on line 10 #import "Adjust.h".

I am using Cordova CLI 11.0.0 and ios 6.2.0 on a Intel MacBook with macOS Monterrey 12.4 and XCode 13.4.1 (13F100).

nijakobius commented 2 years ago

Okay it must have something to do with the latest release (4.30.0) because when I run cordova plugin add com.adjust.sdk@4.29.1, I also get a bunch of warnings, but afterwards I can build the project in XCode.

Installing "com.adjust.sdk" for android
(node:99164) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/myname/Documents/Projekte/appname/App/appname/platforms/android/cordova/node_modules/objectorarray/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
Subproject Path: CordovaLib
Subproject Path: app
Installing "com.adjust.sdk" for browser
(node:99164) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/myname/Documents/Projekte/appname/App/appname/node_modules/objectorarray/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
Installing "com.adjust.sdk" for ios
Adding com.adjust.sdk to package.json
config file undefined requested for changes not found at /Users/myname/Documents/Projekte/appname/App/appname/platforms/android/undefined, ignoring
config file undefined requested for changes not found at /Users/myname/Documents/Projekte/appname/App/appname/platforms/android/undefined, ignoring
config file undefined requested for changes not found at /Users/myname/Documents/Projekte/appname/App/appname/platforms/android/undefined, ignoring
config file /manifest requested for changes not found at /Users/myname/Documents/Projekte/appname/App/appname/platforms/android/manifest, ignoring
[Gradle Properties] Detected Gradle property "android.useAndroidX" with the value of "true", Cordova's recommended value is "false"
[Gradle Properties] Detected Gradle property "android.enableJetifier" with the value of "true", Cordova's recommended value is "false"
avkruze commented 2 years ago

are there any updates? I have the same problem with ios build.

Plugins/com.adjust.sdk/AdjustCordovaDelegate.h:10:9: fatal error: 'Adjust.h' file not found
#import "Adjust.h"
Aditi3 commented 2 years ago

Hi @avkruze and @nielsjakob,

We have tried reproducing the issue on our end, but it's working correctly here.

Could you share the sample project with us where this is reproducible so we can look into this further and assist you?

uzosocom commented 2 years ago

My Podfile has use_frameworks! added from cordova-plugin-firebase-messaging. It seems that the build will fail if use_frameworks! is included. I think my app needs #import <Adjust/Adjust.h>, not #import "Adjust.h".

sample app

uerceg commented 2 years ago

Hey @avkruze and @uzosocom (and @uzosocom thank you for identifying the reason for facing this error message).

We will try to address issue about error saying that Adjust.h import can't be found when usage of frameworks is forced via Podfile in our next SDK update.

uerceg commented 1 year ago

Hey guys,

We have just released Cordova SDK v4.32.0 update where we tried to address this issue. If you can give it a shot and let us know if it fixed your issue, that'd be great. Thank you in advance.

uerceg commented 1 year ago

In case the issue is still around even with latest version of SDK, please feel free to comment / reopen.