Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3499] Application is crashing because of ti.cloud module when we create distribution build for Android.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-04-21T20:44:01.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterAkash Salunkhe
AssigneeShak Hossain
Created2016-04-13T08:08:14.000+0000
Updated2016-04-21T20:44:01.000+0000

Description

Development build is working fine. I am including google play services in the build. But distribution build is crashing on Android devices. I tried to narrow down the problem and found that there is problem in the ti.cloud module where we are calling function subscribe token. Code of this function is like : var Cloud = require('ti.cloud'); // subscribe to channel Cloud.PushNotifications.subscribeToken({ device_token : deviceToken, channel : 'test123', type : osname }, function(e) { if (e.success) { // Call for register device function } else { //display error } }); PFA file for environment details of machine and crash logs.

Attachments

FileDateSize
crashLogs2016-04-13T07:56:20.000+0000107534
environementDetails.txt2016-04-13T07:23:36.000+00003592

Comments

  1. Nazmus Salahin 2016-04-14

    Hello, I am not able to reproduce this issue. I am able to make the app run with both development build and distribution build while using ti.cloud module with the given code. *Steps:* 1. Create a default alloy project for Android with Appcelerator Cloud service enabled. 2. Replace the code in app.js file with the following code.
       var win1 = Titanium.UI.createWindow({
       	title : 'Tab 1',
       	backgroundColor : '#fff'
       });
       
       win1.open();
       
       var Cloud = require('ti.cloud');
       
       var deviceToken;
       
       
       Cloud.PushNotifications.subscribeToken({
       	device_token : deviceToken,
       	channel : 'test123',
       	type: Ti.Platform.name == 'android' ? 'android' : 'ios'
       }, function(e) {
       	if (e.success) {
       		alert('Success' );
       	} else {
       		alert('Error' );;
       	}
       
       });
       
       
       
       
    3. Create a signed apk from the option "Publish-Distribute". 4. Install the apk on Android device and run the app. >> an alert is created. [Screenshot](http://s22.postimg.org/xli70akb5/image.png) Subscribe token does not get successful in my case for obvious reason. Thing to consider here is the app does not get crashed and no error log is produced. Thanks *Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.4.0.201511241829

JSON Source