fabric icon indicating copy to clipboard operation
fabric copied to clipboard

How to setup properly

Open parnanzio opened this issue 9 years ago • 12 comments

Hi, I'm using the v 1.0.1 of this module in my Alloy project.

I followed all the instructions in the documentation, but then it doesn't work. The only way it can load correctly is by opening the builded XCodeProject with XCode and using the standard way to install Crashlytics (by using the Fabric app).

I think there is a smarter way to use this module, isn't it?

My step: . install the plugin . configure the cli hook (for iOS) . install the module . insert the crash code after initialization . run the app

Right now on the Crashlytics dashboard my new version doesn't appear. It appears only when building from XCode (with the process described above).

What am I missing?

parnanzio avatar Sep 19 '16 11:09 parnanzio

Did you try a clean build?

manojdcoder avatar Sep 19 '16 11:09 manojdcoder

Yes.. many times, but is not working.

Here are my steps:

  • change app version
  • clean project
  • initialize fabric module in alloy.js
  • call the crash() function from a button click

In the fabric dashboard the new app version doesn't appear, neither the crash.

parnanzio avatar Sep 19 '16 12:09 parnanzio

Here are some logs:

[object TiFabricModule] loaded
Fabric.Crashlytics.version : 3.8.1
2016-09-19 14:15:27.638 SFA BP 2[34427:9209703] [Crashlytics:Crash] WARNING: CLSLog has been used before (or concurrently with) Crashlytics initialization and cannot be recorded. The message was: 
-[TiCrashlyticsModule leaveBreadcrumb:] line 42 $ (
    "app is crashing now through crash method"
)

This is the function I'm calling:

function simulateCrash(){
    FABRIC.Crashlytics.leaveBreadcrumb("app is crashing now through crash method");
    FABRIC.Crashlytics.crash();
}

parnanzio avatar Sep 19 '16 12:09 parnanzio

@chrisribe do you think the problem could be in the shell script not being executed?

parnanzio avatar Sep 20 '16 14:09 parnanzio

@parnanzio how did you integrate it? I copied ti.fabric folder to ti.plugins, but I'm getting "Couldn't find module: ti.fabric for architecture: armv7". I realised, that ti.fabric folder doesn't contain iphone folder, and I copied it to ti.fabric. But result is the same.

zozo4kin avatar Sep 22 '16 13:09 zozo4kin

@zozo4kin there are some steps not written. You must:

  • download the module and compile by yourself
  • use the compiled module in your project
  • install the Fabric.io app, open the xcodeproject file from the build directory and install the fabric plugin to register the app.
  • pray

I'm still having problems when compiling from Titanium: the module is integrated in the app, but cannot trace any crash..

Please @manojdcoder / @chrisribe reply with the right steps to install this module!

parnanzio avatar Sep 22 '16 15:09 parnanzio

Hi Parnanzio and zozo4kin,

If you are not seeing the app in the dashboard it means it did not register correctly. I am out of the country right now. But if I remember correctly, you must install and run the Fabric.io app. Then open your app build in xcode. There are instructions to register the app via xcode. Then you must copy the secret key to the module... I am not sure of the last part, I may be confusing another project. I would to review my code and submit an example.

https://docs.fabric.io/apple/fabric/settings/api-keys.html

Hope this points you in the right direction... Chris

chrisribe avatar Sep 22 '16 16:09 chrisribe

@chrisribe Thanks for the reply, but the problem is not about the secret key or the registration of the app. The problem is that once the app is registered, nothing gets traced on fabric.io. If I try to log something or crash the app, on the dashboard nothing is received. And new version of the app are not visible if I don't pass through XCode.

The module from Titanium is not triggered. @manojdcoder said it could be the shell script is not executed. From the code:

shellScript = '\\nchmod 755 ../../modules/iphone/ti.fabric/' + VERSION + '/platform/Fabric.framework/run\\n..

parnanzio avatar Sep 23 '16 07:09 parnanzio

@chrisribe @manojdcoder I debugged the cli hook and it seems that the script cannot find the name="Post-Compile" string to inject the code! https://github.com/manojdcoder/fabric/blob/master/plugins/ti.fabric/cli/hooks/run.js#L50

parnanzio avatar Sep 23 '16 08:09 parnanzio

Did anyone manage to integrate Crashlytics in alloy project? If yes can you guys help me to do it?

prjoshi60 avatar Mar 17 '17 07:03 prjoshi60

@chrisribe @manojdcoder

We have tried the above module, integrated everything as per the instructions for iOS. After running the app in simulator we find the logs as follows.

[INFO] : crash1/1.0 (5.2.2.b685ddb) [INFO] : [object TiFabricModule] loaded [INFO] : Fabric.Crashlytics.version : 3.7.2 [INFO] : ACS Login Results for environment development:

[INFO] : 2017-05-10 19:47:17.608 crash1[73986:509440] [Crashlytics:Crash] Warning: NSUncaughtExceptionHandler is 'TiUncaughtExceptionHandler' in '/Users/XXXX/Library/Developer/CoreSimulator/Devices/71B148C9-E09E-4334-9FEE-AE40955FCD48/data/Containers/Bundle/Application/4BABB52F-A328-4A67-A9F8-677D0674614E/crash1.app/crash1' [INFO] : 2017-05-10 19:47:35.455 crash1[73986:509440] [Crashlytics:Answers] Answers Event tracking is disabled for this application. Ignoring CLSAnswersSignUpEvent { { [INFO] : method = "signup-button"; [INFO] : success = true; [INFO] : } customAttributes={ [INFO] : }} [INFO] : 2017-05-10 19:47:46.453 crash1[73986:509440] [Crashlytics:Answers] Answers Event tracking is disabled for this application. Ignoring CLSAnswersCustomEvent { { [INFO] : customEvtName = customValue; [INFO] : } } [INFO] : 2017-05-10 19:47:47.262 crash1[73986:509440] [Crashlytics:Answers] Answers Event tracking is disabled for this application. Ignoring CLSAnswersCustomEvent { { [INFO] : customEvtName = customValue; [INFO] : } } [INFO] : 2017-05-10 19:47:48.898 crash1[73986:509440] [Crashlytics:Answers] Answers Event tracking is disabled for this application. Ignoring CLSAnswersSignUpEvent { { [INFO] : method = "signup-button"; [INFO] : success = true; [INFO] : } customAttributes={ [INFO] : }} [INFO] : Application started [INFO] : crash1/1.0 (5.2.2.b685ddb) [INFO] : [object TiFabricModule] loaded [INFO] : Fabric.Crashlytics.version : 3.7.2 [INFO] : 2017-05-10 19:47:51.834 crash1[74082:510685] [Crashlytics:Crash:Reports] Packaged report with id '931b973bd1574954807744ff42eec90e' for submission [INFO] : 2017-05-10 19:47:51.835 crash1[74082:510685] [Crashlytics:Crash:Reports] Submitting report [INFO] : 2017-05-10 19:47:51.835 crash1[74082:510685] [[Crashlytics:Crash:Reports]] Submitting async /Users/XXXX/Library/Developer/CoreSimulator/Devices/71B148C9-E09E-4334-9FEE-AE40955FCD48/data/Containers/Data/Application/CD139A58-364B-4A6A-806A-1FF1904F9CC2/Library/Caches/com.crashlytics.data/com.vmware.crash1/v3/prepared/50BFCF3C-7344-458D-BB81-D18FCBA9147C.multipartmime

[INFO] : 2017-05-10 19:47:54.309 crash1[74082:510669] [Crashlytics:Crash:Reports] completed submission of /Users/XXXXX/Library/Developer/CoreSimulator/Devices/71B148C9-E09E-4334-9FEE-AE40955FCD48/data/Containers/Data/Application/CD139A58-364B-4A6A-806A-1FF1904F9CC2/Library/Caches/com.crashlytics.data/com.vmware.crash1/v3/prepared/50BFCF3C-7344-458D-BB81-D18FCBA9147C.multipartmime [INFO] : 2017-05-10 19:47:54.310 crash1[74082:510669] [Crashlytics:Crash] report submission successful

**But we are not able to see the entries for the same on Crashlytics Dashboard. **

prjoshi60 avatar May 10 '17 14:05 prjoshi60

Hi @prjoshi60 , did you ever encounter the original problem? [Crashlytics:Crash] WARNING: CLSLog has been used before (or concurrently with) Crashlytics initialization and cannot be recorded. The message was: -[TiCrashlyticsModule leaveBreadcrumb:] line 42 $ ( "app is crashing now through crash method" )

The app crashes when I test using crash() but my logs only display what is above, not as much as your logs. I am working on a Titanium project using SDK 6.0.0 and have

  • followed the instructions on the read me
  • build the module and have Crashlytic module in the project (I can display the version number)
  • used a valid API Key and Secret

aleang avatar May 28 '17 21:05 aleang