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

Android push notification beta crash + API issue #323

Closed
mattheworiordan opened this issue May 8, 2017 · 16 comments
Closed

Android push notification beta crash + API issue #323

mattheworiordan opened this issue May 8, 2017 · 16 comments
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@mattheworiordan
Copy link
Member

mattheworiordan commented May 8, 2017

Reported by customer Edgar:

I was checking Android push notification implementation and I can't seem to subscribe to a channel after receiving the callback from 'activate'. ablyRealtime.channels.get("").push
I tried the following: ablyRealtime.channels.get("channel_name").push -- Apparently push doesn't exist. I did as the installation instructions indicate.

Also, reported a crash:

Another issue is that after executing this: ablyRealtime.push.activate(context);
The app crashes and I get:
05-05 01:59:30.878 20620-20620/ee.app.conversamanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: ee.app.conversamanager, PID: 20620
java.lang.NoClassDefFoundError: io.azam.ulidj.ULID
at io.ably.lib.rest.LocalDevice.load(LocalDevice.java:33)
at io.ably.lib.rest.AblyRest.device(AblyRest.java:21)
at io.ably.lib.rest.Push$ActivationStateMachine$NotActivated.transition(Push.java:147)
at io.ably.lib.rest.Push$ActivationStateMachine.handleEvent(Push.java:449)
at io.ably.lib.rest.Push.activate(Push.java:39)
at io.ably.lib.rest.Push.activate(Push.java:34)
at ee.app.conversamanager.management.AblyConnection.initAbly(AblyConnection.java:86)
at ee.app.conversamanager.ActivityMain.onCreate(ActivityMain.java:60)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

@mattheworiordan mattheworiordan added bug Something isn't working. It's clear that this does need to be fixed. push labels May 8, 2017
@tcard tcard self-assigned this May 8, 2017
@itolisto
Copy link

Hi @mattheworiordan @tcard,

Any updates on this? Can I help with something?

@mattheworiordan
Copy link
Member Author

@itolisto sorry for not replying. I will remind @tcard to look into this.

@itolisto
Copy link

Thank you @mattheworiordan and @tcard.

@tcard
Copy link
Contributor

tcard commented May 24, 2017

Hi @itolisto! I'm currently working on this. I'll get a solution out as soon as possible. Sorry for the delay!

@paddybyers
Copy link
Member

@tcard is it a proguard.txt issue? Any class that's loaded by name (eg with a Class.forName()) needs to be excluded from the name minimisation/obfuscation.

@tcard
Copy link
Contributor

tcard commented May 26, 2017

@paddybyers They're loaded with plain imports, but even then I've tried a number of changes to proguard.txt and still doesn't work.

tcard added a commit that referenced this issue May 31, 2017
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
@tcard
Copy link
Contributor

tcard commented May 31, 2017

@itolisto I've updated our push branch and the instructions at #308. Could you please try again with that?

@itolisto
Copy link

itolisto commented Jun 1, 2017

@tcard I'm following the build instructions properly but I'm getting an error.

Here's the stack trace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:48)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:104)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:53)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:163)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:145)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 60 more

Heres when I run with info flag:

file or directory 'xx/ably-java/android/src/debug/java', not found
Executing task ':android:compileDebugJavaWithJavac' (up-to-date check took 0.007 secs) due to:
No history is available.
All input files are considered out-of-date for incremental task ':android:compileDebugJavaWithJavac'.
Compiling with source level 1.7 and target level 1.7.
file or directory 'xx/ably-java/android/src/debug/java', not found
Compiling with JDK Java compiler API.
xx/ably-java/lib/src/main/java/io/ably/lib/rest/PushBase.java:8: error: cannot find symbol
import io.ably.lib.http.HttpExecutor;
^
symbol: class HttpExecutor
location: package io.ably.lib.http
xx/ably-java/lib/src/main/java/io/ably/lib/rest/PushBase.java:50: error: package HttpExecutor does not exist
private HttpExecutor.Request _publish(final Param[] recipient, final JsonObject payload) {
^
xx/ably-java/lib/src/main/java/io/ably/lib/rest/PushBase.java:51: error: package HttpExecutor does not exist
return rest.httpExecutor.request(new HttpExecutor.Plan() {
^
xx/ably-java/lib/src/main/java/io/ably/lib/rest/PushBase.java:51: error: cannot find symbol
return rest.httpExecutor.request(new HttpExecutor.Plan() {
^
symbol: variable httpExecutor
location: variable rest of type AblyRest
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
:android:compileDebugJavaWithJavac FAILED

@tcard
Copy link
Contributor

tcard commented Jun 1, 2017

@itolisto Sorry, that should be fixed now too. I committed some code that I shouldn't have! And I didn't catch the compilation error myself since I do have the missing files outside of the commit.

@itolisto
Copy link

itolisto commented Jun 2, 2017

@tcard No worries, I'll try it right away! I'll let you know the result in a few minutes

@itolisto
Copy link

itolisto commented Jun 2, 2017

@tcard It's now compiling without problem but I'm still not able to see the 'push' parameter. Take a look:

current

And this is how my build.gradle file looks like:

current2

Am I doing something wrong?

@itolisto
Copy link

itolisto commented Jun 6, 2017

Hi @tcard, can I help you with something to fix this? Am I doing something wrong? Thank you for your support.

@tcard
Copy link
Contributor

tcard commented Jun 6, 2017

Sorry @itolisto, I'm just pretty busy at the moment so I haven't had a chance to look into this. I will first thing tomorrow.

@itolisto
Copy link

itolisto commented Jun 7, 2017

Don't worry @tcard in any case I don't mean to be annoying, sorry if I am, I imagine you are pretty busy.

@tcard
Copy link
Contributor

tcard commented Jun 7, 2017

@itolisto Sorry again for the delay. We were exposing the push in REST channels, but not in realtime channels. That should be fixed now. Could you try again?

@itolisto
Copy link

itolisto commented Jun 9, 2017

@tcard I can see push now, thank you. BTW I opened another issue related to push notifications, I would really appreciate your help.

tcard added a commit that referenced this issue Aug 17, 2017
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
@tcard tcard closed this as completed Aug 25, 2017
tcard added a commit that referenced this issue Oct 16, 2017
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
tcard added a commit that referenced this issue Oct 16, 2017
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
paddybyers pushed a commit that referenced this issue Mar 2, 2018
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
paddybyers pushed a commit that referenced this issue Jul 31, 2018
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
paddybyers pushed a commit that referenced this issue Nov 14, 2018
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
paddybyers pushed a commit that referenced this issue Dec 11, 2018
This is needed for the push beta, since we're not releasing versions
for it but telling users to just generate and include the AAR. But we
still need them to install our dependencies, so they need to include
our dependencies.gradle files from their own .gradle files.

See #323.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

No branches or pull requests

4 participants