Browse Source

[Android] Crashlytics

j8
Lyubomir Marinov 9 years ago
parent
commit
d875b35b32

+ 34
- 17
android/app/build.gradle View File

1
-apply plugin: "com.android.application"
1
+buildscript {
2
+    repositories {
3
+        maven { url 'https://maven.fabric.io/public' }
4
+    }
5
+
6
+    dependencies {
7
+        classpath 'io.fabric.tools:gradle:1.+'
8
+    }
9
+}
10
+
11
+apply plugin: 'com.android.application'
12
+apply plugin: 'io.fabric'
2
 
13
 
3
 import com.android.build.OutputFile
14
 import com.android.build.OutputFile
4
 
15
 
65
  * ]
76
  * ]
66
  */
77
  */
67
 
78
 
68
-apply from: "../../node_modules/react-native/react.gradle"
79
+apply from: '../../node_modules/react-native/react.gradle'
69
 
80
 
70
 /**
81
 /**
71
  * Set this to true to create two separate APKs instead of one:
82
  * Set this to true to create two separate APKs instead of one:
84
 
95
 
85
 android {
96
 android {
86
     compileSdkVersion 23
97
     compileSdkVersion 23
87
-    buildToolsVersion "23.0.1"
98
+    buildToolsVersion '23.0.1'
88
 
99
 
89
     defaultConfig {
100
     defaultConfig {
90
-        applicationId "org.jitsi.jitsi_meet_react"
101
+        applicationId 'org.jitsi.jitsi_meet_react'
91
         minSdkVersion 16
102
         minSdkVersion 16
92
         targetSdkVersion 22
103
         targetSdkVersion 22
93
         versionCode 1
104
         versionCode 1
94
-        versionName "1.0"
105
+        versionName '1.0'
95
         ndk {
106
         ndk {
96
-            abiFilters "armeabi-v7a", "x86"
107
+            abiFilters 'armeabi-v7a', 'x86'
97
         }
108
         }
98
         packagingOptions {
109
         packagingOptions {
99
             // The project react-native does not provide 64-bit binaries at the
110
             // The project react-native does not provide 64-bit binaries at the
100
             // time of this writing. Unfortunately, packaging any 64-bit
111
             // time of this writing. Unfortunately, packaging any 64-bit
101
             // binaries into the .apk will crash the app at runtime on 64-bit
112
             // binaries into the .apk will crash the app at runtime on 64-bit
102
             // platforms.
113
             // platforms.
103
-            exclude "lib/x86_64/libjingle_peerconnection_so.so"
104
-            exclude "lib/arm64-v8a/libjingle_peerconnection_so.so"
114
+            exclude 'lib/x86_64/libjingle_peerconnection_so.so'
115
+            exclude 'lib/arm64-v8a/libjingle_peerconnection_so.so'
105
         }
116
         }
106
     }
117
     }
107
     splits {
118
     splits {
109
             reset()
120
             reset()
110
             enable enableSeparateBuildPerCPUArchitecture
121
             enable enableSeparateBuildPerCPUArchitecture
111
             universalApk false  // If true, also generate a universal APK
122
             universalApk false  // If true, also generate a universal APK
112
-            include "armeabi-v7a", "x86"
123
+            include 'armeabi-v7a', 'x86'
113
         }
124
         }
114
     }
125
     }
115
     buildTypes {
126
     buildTypes {
116
         release {
127
         release {
117
             minifyEnabled enableProguardInReleaseBuilds
128
             minifyEnabled enableProguardInReleaseBuilds
118
-            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
129
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
119
         }
130
         }
120
     }
131
     }
121
     // applicationVariants are e.g. debug, release
132
     // applicationVariants are e.g. debug, release
123
         variant.outputs.each { output ->
134
         variant.outputs.each { output ->
124
             // For each separate APK per architecture, set a unique version code as described here:
135
             // For each separate APK per architecture, set a unique version code as described here:
125
             // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
136
             // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
126
-            def versionCodes = ["armeabi-v7a":1, "x86":2]
137
+            def versionCodes = ['armeabi-v7a':1, 'x86':2]
127
             def abi = output.getFilter(OutputFile.ABI)
138
             def abi = output.getFilter(OutputFile.ABI)
128
             if (abi != null) {  // null for the universal-debug, universal-release variants
139
             if (abi != null) {  // null for the universal-debug, universal-release variants
129
                 output.versionCodeOverride =
140
                 output.versionCodeOverride =
133
     }
144
     }
134
 }
145
 }
135
 
146
 
136
-if (project.hasProperty("JITSI_SIGNING")
137
-        && new File(project.property("JITSI_SIGNING")).exists()) {
138
-    apply from: project.property("JITSI_SIGNING");
147
+if (project.hasProperty('JITSI_SIGNING')
148
+        && new File(project.property('JITSI_SIGNING')).exists()) {
149
+    apply from: project.property('JITSI_SIGNING');
139
 }
150
 }
140
 
151
 
152
+repositories {
153
+    maven { url 'https://maven.fabric.io/public' }
154
+}
141
 dependencies {
155
 dependencies {
142
     compile project(':react-native-vector-icons')
156
     compile project(':react-native-vector-icons')
143
     compile project(':react-native-webrtc')
157
     compile project(':react-native-webrtc')
144
-    compile fileTree(dir: "libs", include: ["*.jar"])
145
-    compile "com.android.support:appcompat-v7:23.0.1"
146
-    compile "com.facebook.react:react-native:+"  // From node_modules
158
+    compile fileTree(dir: 'libs', include: ['*.jar'])
159
+    compile 'com.android.support:appcompat-v7:23.0.1'
160
+    compile 'com.facebook.react:react-native:+'
161
+    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
162
+        transitive = true
163
+    }
147
 }
164
 }
148
 
165
 
149
 apply from: '../../node_modules/react-native-vector-icons/fonts.gradle'
166
 apply from: '../../node_modules/react-native-vector-icons/fonts.gradle'

+ 3
- 0
android/app/src/main/AndroidManifest.xml View File

43
       </activity>
43
       </activity>
44
       <activity
44
       <activity
45
         android:name="com.facebook.react.devsupport.DevSettingsActivity" />
45
         android:name="com.facebook.react.devsupport.DevSettingsActivity" />
46
+      <meta-data
47
+        android:name="io.fabric.ApiKey"
48
+        android:value="a8ae24a58302ba79da1d312138e941f6b86e3242" />
46
     </application>
49
     </application>
47
 </manifest>
50
 </manifest>

+ 10
- 0
android/app/src/main/java/org/jitsi/jitsi_meet_react/MainActivity.java View File

1
 package org.jitsi.jitsi_meet_react;
1
 package org.jitsi.jitsi_meet_react;
2
 
2
 
3
+import android.os.Bundle;
4
+import com.crashlytics.android.Crashlytics;
3
 import com.facebook.react.ReactActivity;
5
 import com.facebook.react.ReactActivity;
4
 import com.facebook.react.ReactActivityDelegate;
6
 import com.facebook.react.ReactActivityDelegate;
5
 import com.facebook.react.ReactRootView;
7
 import com.facebook.react.ReactRootView;
8
+import io.fabric.sdk.android.Fabric;
6
 
9
 
7
 public class MainActivity extends ReactActivity {
10
 public class MainActivity extends ReactActivity {
8
     /**
11
     /**
43
     protected String getMainComponentName() {
46
     protected String getMainComponentName() {
44
         return "App";
47
         return "App";
45
     }
48
     }
49
+
50
+    @Override
51
+    protected void onCreate(Bundle savedInstanceState) {
52
+        super.onCreate(savedInstanceState);
53
+
54
+        Fabric.with(this, new Crashlytics());
55
+    }
46
 }
56
 }

Loading…
Cancel
Save