Add Crashlytics NDK to Android
Closes #2107 Conflicts: Makefile android/java/MapboxGLAndroidSDKTestApp/build.gradle
This commit is contained in:
4
Makefile
4
Makefile
@@ -130,8 +130,8 @@ clean: clear_sqlite_cache clear_xcode_cache
|
||||
-rm -rf ./ios/build
|
||||
-rm -rf ./test/build
|
||||
-rm -rf ./config/*.gypi
|
||||
-rm -rf ./android/java/build ./android/java/MapboxGLAndroidSDKTestApp/build ./android/java/MapboxGLAndroidSDKTestApp/build
|
||||
-rm -rf ./android/java/MapboxGLAndroidSDK/src/main/jniLibs ./android/java/MapboxGLAndroidSDK/src/main/assets
|
||||
-rm -rf ./android/java/build ./android/java/MapboxGLAndroidSDK/build ./android/java/MapboxGLAndroidSDKTestApp/build
|
||||
-rm -rf ./android/java/MapboxGLAndroidSDK/src/main/libs ./android/java/MapboxGLAndroidSDK/src/main/obj.target ./android/java/MapboxGLAndroidSDK/src/main/assets
|
||||
-rm -f ./android/test/features.zip
|
||||
|
||||
distclean: clean
|
||||
|
||||
6
android/java/.gitignore
vendored
6
android/java/.gitignore
vendored
@@ -10,6 +10,12 @@ build/
|
||||
*.so
|
||||
*.apk
|
||||
|
||||
# JNI
|
||||
MapboxGLAndroidSDK/src/main/libs/
|
||||
MapboxGLAndroidSDK/src/main/jniLibs/
|
||||
MapboxGLAndroidSDK/src/main/obj/
|
||||
MapboxGLAndroidSDK/src/main/obj.target/
|
||||
|
||||
# Lib assets
|
||||
MapboxGLAndroidSDK/src/main/assets/
|
||||
|
||||
|
||||
@@ -76,6 +76,21 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include 'armeabi', 'armeabi-v7a', 'x86', 'mips'
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
crashlytics {
|
||||
enableNdk true
|
||||
androidNdkOut '../MapboxGLAndroidSDK/src/main/obj.target'
|
||||
androidNdkLibsOut '../MapboxGLAndroidSDK/src/main/obj.target'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -89,6 +104,9 @@ dependencies {
|
||||
compile('com.crashlytics.sdk.android:crashlytics:2.5.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.crashlytics.android.ndk.CrashlyticsNdk;
|
||||
import com.mapbox.mapboxgl.annotations.Marker;
|
||||
import com.mapbox.mapboxgl.annotations.MarkerOptions;
|
||||
import com.mapbox.mapboxgl.annotations.PolygonOptions;
|
||||
@@ -77,7 +78,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Fabric.with(this, new Crashlytics());
|
||||
Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());
|
||||
|
||||
// Load the layout
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
@@ -74,13 +74,19 @@
|
||||
],
|
||||
'destination': '<(pwd)/../android/java/MapboxGLAndroidSDK/src/main/assets'
|
||||
},
|
||||
{
|
||||
'files': [
|
||||
'<(PRODUCT_DIR)/obj.target'
|
||||
],
|
||||
'destination': '<(pwd)/../android/java/MapboxGLAndroidSDK/src/main'
|
||||
},
|
||||
],
|
||||
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'Strip dynamic library',
|
||||
'inputs': [ '<(PRODUCT_DIR)/lib.target/libmapbox-gl.so' ],
|
||||
'outputs': [ '<(pwd)/../android/java/MapboxGLAndroidSDK/src/main/jniLibs/$(JNIDIR)/libmapbox-gl.so' ],
|
||||
'outputs': [ '<(pwd)/../android/java/MapboxGLAndroidSDK/src/main/libs/$(JNIDIR)/libmapbox-gl.so' ],
|
||||
'action': [ '$(STRIP)', '<@(_inputs)', '-o', '<@(_outputs)' ]
|
||||
},
|
||||
],
|
||||
|
||||
@@ -39,16 +39,20 @@ if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
|
||||
|
||||
S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${TRAVIS_JOB_NUMBER}
|
||||
APK_OUTPUTS=./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk
|
||||
JNILIB=`mason env JNIDIR`
|
||||
|
||||
# Upload either the debug or the release build
|
||||
if [ ${BUILDTYPE} == "Debug" ] ; then
|
||||
aws s3 cp \
|
||||
${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-debug.apk \
|
||||
${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk
|
||||
elif [ ${BUILDTYPE} == "Release" ] ; then
|
||||
aws s3 cp \
|
||||
${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-release-unsigned.apk \
|
||||
${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk
|
||||
# ARM64 does not build APK for now
|
||||
if [ ${JNIDIR} != "arm64-v8a" ] ; then
|
||||
# Upload either the debug or the release build
|
||||
if [ ${BUILDTYPE} == "Debug" ] ; then
|
||||
aws s3 cp \
|
||||
${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-${JNILIB}-debug.apk \
|
||||
${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk
|
||||
elif [ ${BUILDTYPE} == "Release" ] ; then
|
||||
aws s3 cp \
|
||||
${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-${JNILIB}-release-unsigned.apk \
|
||||
${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk
|
||||
fi
|
||||
fi
|
||||
|
||||
mapbox_time_finish
|
||||
|
||||
Reference in New Issue
Block a user