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

Fabric: Create simple bash script that creates the entries you need to add to your Info.plist.xml to make Fabric work in your app #99

Open
BlueRiverInteractive opened this issue Feb 14, 2016 · 5 comments
Assignees

Comments

@BlueRiverInteractive
Copy link
Contributor

No description provided.

@dzungpv
Copy link

dzungpv commented Feb 16, 2016

@BlueRiverInteractive Do you have any sample that Answers work? I add this to Info.plist.xml:

        <dict>
            <key>APIKey</key>
            <string>mysecretkey</string>
            <key>Kits</key>
            <array>
                <dict>
                    <key>KitInfo</key>
                    <dict/>
                    <key>KitName</key>
                    <string>Answers</string>
                </dict>
            </array>
        </dict>

And this code to didFinishLaunching:

Fabric.with(Answers.class);

But it not work, app not show in Fabric portal.

@codegist
Copy link

Same here, after adding the corresponding APIKey entry in Info.plist.xml, and the Fabric init, I get the following logs:

Crashlytics:Answers] Answers is disabled. Cleaning up session directory
[Fabric] Initialized with kit versions: {
    "com.twitter.answers.ios" = "1.1.0";
    "com.twitter.crashlytics.ios" = "3.6.0";
    "io.fabric.sdk.ios" = "1.6.1";
}

And the app won't show up in the Fabric dashboard.
I tried creating a test xcode project and following Fabric's tutorial and it worked.
I believe the step missing here is what the android's io.fabric gradle build tool plugin is doing, eg uploading the app to fabric.
Which in the xcode environment is done by adding a Run Script Build Phase as

./Fabric.framework/run

which is turns seems to be handling what fabric needs to register the app. Not sure that will fix the
Crashlytics:Answers] Answers is disabled. Cleaning up session directory
though..

I've seen this "run" script bundled as well in the robovm version so that should be feasible.

@dzungpv
Copy link

dzungpv commented Feb 16, 2016

In Xcode base project, Fabric must run sh script and it upload dsym to Fabric server. I don't know Answers require it but this is ./Fabric.framework/run script content:

#!/bin/sh

#  run
#
#  Copyright (c) 2015 Crashlytics. All rights reserved.

#  Figure out where we're being called from
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

#  Quote path in case of spaces or special chars
DIR="\"${DIR}"

PATH_SEP="/"
VALIDATE_COMMAND="uploadDSYM\" $@ validate run-script"
UPLOAD_COMMAND="uploadDSYM\" $@ run-script"

#  Ensure params are as expected, run in sync mode to validate
eval $DIR$PATH_SEP$VALIDATE_COMMAND
return_code=$?

if [[ $return_code != 0 ]]; then
  exit $return_code
fi

#  Verification passed, upload dSYM in background to prevent Xcode from waiting
#  Note: Validation is performed again before upload.
#  Output can still be found in Console.app
eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 &

I try to run this after build process but without success, it hard to automate find Fabric.framework in gradle cache folder, one solution is copy to projects folder, but what about dsym, so I use facebook analytics instead and waiting for solution.

@codegist
Copy link

Are you getting the same log I'm getting in your app?

Crashlytics:Answers] Answers is disabled. Cleaning up session directory

@dungelin
Copy link

Finally i can make it work, you can follow this simple step:
1, Create and empty tab Xcode Application.
2, Change app name, bundle, version, build and icon same with your robovm app.
3, Close xcode and open fabric mac app and setup answer only. Follow step and then run your Xcode app. Make sure you open Fabric answers and see it work. Open Info plis as source and copy:

        <dict>
            <key>APIKey</key>
            <string>mysecretkey</string>
            <key>Kits</key>
            <array>
                <dict>
                    <key>KitInfo</key>
                    <dict/>
                    <key>KitName</key>
                    <string>Answers</string>
                </dict>
            </array>
        </dict>

4, Close xcode, back to your robovm app, paste to Info.plist.xml. add this code to IOSLaucher and it will work:

        Fabric.getSharedSDK().setDebug(true);
        Fabric.with(Answers.class);

I am asking fabric team to find more automate step. Because Fabric will upload icon, send bundle id and more to fabric server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants