Pushwoosh / pushwoosh-appcelerator-titanium

Other
33 stars 16 forks source link

SDK 9.2.2.GA- Firebase conflicts #79

Closed macasfaj closed 3 years ago

macasfaj commented 3 years ago

Hi there! I have issues in my project, using SDK 9.2.2.GA.

PW module: 5.20.1

I've installed firebase.core and firebase.analytics and I get some errors like this:

`ERROR]  [GRADLE]

[ERROR]  [GRADLE] FAILURE: Build failed with an exception.

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] * What went wrong:

[ERROR]  [GRADLE] Execution failed for task ':app:mergeDebugJavaResource'.

[ERROR]  [GRADLE] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

[ERROR]  [GRADLE] > More than one file was found with OS independent path 'firebase-iid.properties'.`

I only can build my App if I remove from Pushwoosh module these libs:

In this case, the App can be built, but i get this error when the App start and I init Pushwoosh:

` E/WM-WorkerWrapper: Work [ id=dcc67491-eaa4-488d-a273-250e3514e9a4, tags={ com.pushwoosh.internal.registrar.RegistrarWorker } ] failed because it threw an exception/error

[ERROR]  E/WM-WorkerWrapper: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Given String is empty or null`

Could you help me? We're blocked in this situation.

Thanks!!!!

macasfaj commented 3 years ago

More help. If I send a PN from Pushwoosh panel, I get this:

`[ERROR]  TiExceptionHandler: (main) [639410,817785] Unable to instantiate service com.pushwoosh.PushFcmIntentService: java.lang.ClassNotFoundException: Didn't find class "com.pushwoosh.PushFcmIntentService" on path: DexPathList[[zip file "/data/app/city.mapyour-4wiBp5LVV7LCxMdVKelazw==/base.apk"],nativeLibraryDirectories=[/data/app/city.mapyour-4wiBp5LVV7LCxMdVKelazw==/lib/arm64, /data/app/city.mapyour-4wiBp5LVV7LCxMdVKelazw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]

[ERROR]  TiExceptionHandler:

[ERROR]  TiExceptionHandler: dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)

[ERROR]  TiExceptionHandler: java.lang.ClassLoader.loadClass(ClassLoader.java:379)

[ERROR]  TiExceptionHandler: java.lang.ClassLoader.loadClass(ClassLoader.java:312)

[ERROR]  TiExceptionHandler: android.app.ActivityThread.handleCreateService(ActivityThread.java:3526)

[ERROR]  TiExceptionHandler: android.app.ActivityThread.-wrap4(Unknown Source:0)

[ERROR]  TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1786)

[ERROR]  TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:105)

[ERROR]  TiExceptionHandler: android.os.Looper.loop(Looper.java:164)

[ERROR]  TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6944)

[ERROR]  TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)

[ERROR]  TiExceptionHandler: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)

[ERROR]  TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)`

I hope it helps, thanks!

macasfaj commented 3 years ago

Any update? We need to release soon and we're blocked. Thanks!

macasfaj commented 3 years ago

@wfhm Please, any feedback about this issue? Thanks.

wfhm commented 3 years ago

@macasfaj,

Right now we are finishing works on the new release that will completely support SDK 9.+ features, and the conflicts will be automatically resolved by gradle. The ETA is not more than 2 weeks, so we put this ticket on hold until then.

macasfaj commented 3 years ago

Ok, thanks!

wfhm commented 3 years ago

@macasfaj,

The new version is released, could you please try it and let us know if the issue persists?

macasfaj commented 3 years ago

Sure, I will. Thanks!!!

macasfaj commented 3 years ago

@wfhm Thank you for the release, but it's not working yet. Firebase works and the App is built without issues, but Pushwoosh module doesn't work. I get this issue:

`ERROR]  E/WM-WorkerWrapper: Work [ id=221f90db-9e2a-45f3-a7c7-0b183c7823a1, tags={ com.pushwoosh.firebase.internal.registrar.FcmRegistrarWorker } ] failed because it threw an exception/error

[ERROR]  E/WM-WorkerWrapper: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google.

[ERROR]  E/WM-WorkerWrapper: at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:516)

[ERROR]  E/WM-WorkerWrapper: at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:475)

[ERROR]  E/WM-WorkerWrapper: at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:298)

[ERROR]  E/WM-WorkerWrapper: at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)

[ERROR]  E/WM-WorkerWrapper: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)

[ERROR]  E/WM-WorkerWrapper: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)

[ERROR]  E/WM-WorkerWrapper: at java.lang.Thread.run(Thread.java:764)

[ERROR]  E/WM-WorkerWrapper: Caused by: java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google.

[ERROR]  E/WM-WorkerWrapper: at com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source:8)

[ERROR]  E/WM-WorkerWrapper: at com.google.firebase.iid.FirebaseInstanceId.zza(com.google.firebase:firebase-iid@@20.2.1:52)

[ERROR]  E/WM-WorkerWrapper: at com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid@@20.2.1:2)

[ERROR]  E/WM-WorkerWrapper: at com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid@@20.2.1:1)

[ERROR]  E/WM-WorkerWrapper: at com.pushwoosh.firebase.internal.registrar.FcmRegistrarWorker.a(Unknown Source:18)

[ERROR]  E/WM-WorkerWrapper: at com.pushwoosh.firebase.internal.registrar.FcmRegistrarWorker.doWork(Unknown Source:23)

[ERROR]  E/WM-WorkerWrapper: at androidx.work.Worker$1.run(Worker.java:85)

[ERROR]  E/WM-WorkerWrapper: ... 3 more`

Could you have a look into it? Thanks!

wfhm commented 3 years ago

@macasfaj,

Could you please share the code of your pushwoosh.initialize() call? Also, did you add the google-services.json to your app as per our guide?

macasfaj commented 3 years ago

Hi!

It's working now!

I've moved google-services.json to app/platform/android (It was in app/assets/android for Firebase) . And I get this:

`[ERROR]  [GRADLE] [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/src/main/res/values/strings.xml [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/build/generated/res/google-services/debug/values/values.xml: Resource and asset merger: Duplicate resources

[ERROR]  [GRADLE] [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/src/main/res/values/strings.xml [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/build/generated/res/google-services/debug/values/values.xml: Resource and asset merger: Duplicate resources

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] FAILURE: Build failed with an exception.

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] * What went wrong:

[ERROR]  [GRADLE] Execution failed for task ':app:mergeDebugResources'.

[ERROR]  [GRADLE] > [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/src/main/res/values/strings.xml [string/google_app_id] /Users/Migue/Documents/NubecitaSVN/myc-app/build/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] * Try:

[ERROR]  [GRADLE] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] * Get more help at https://help.gradle.org

[ERROR]  [GRADLE]

[ERROR]  [GRADLE] BUILD FAILED in 1s`

This is because I have this in platform/res/values/strings.xml

mygoogleAppIdHere

So I deleted that line from string.xml, it works like a charm!

Thank you! 🥇