Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
update ndk for new sentry-native version (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Feb 3, 2020
1 parent 89439ba commit 9e19eaf
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object Config {

val buildToolsVersion = "29.0.3"
val minSdkVersion = 14
val minSdkVersionNdk = 21
val minSdkVersionNdk = 16
val targetSdkVersion = sdkVersion
val compileSdkVersion = sdkVersion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/** Enables the NDK error reporting for Android */
public final class NdkIntegration implements Integration {
private boolean isNdkAvailable() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {
} else {
"sentry-native"
}
println("sentry-android-ndk: $sentryNativeSrc")

defaultConfig {
targetSdkVersion(Config.Android.targetSdkVersion)
Expand Down
2 changes: 1 addition & 1 deletion sentry-android-ndk/sentry-native
Submodule sentry-native updated 180 files
7 changes: 5 additions & 2 deletions sentry-android-ndk/src/main/jni/sentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct transport_options {

struct transport_options g_transport_options;

static void send_envelope(const sentry_envelope_t *envelope, void *data) {
static void send_envelope(sentry_envelope_t *envelope, void *data) {
char envelope_id_str[40];
char outbox_path[4096];

Expand Down Expand Up @@ -43,7 +43,10 @@ JNIEXPORT void JNICALL Java_io_sentry_android_ndk_SentryNdk_initSentryNative(JNI
g_transport_options.cls = cls;

sentry_options_t *options = sentry_options_new();
sentry_options_set_transport(options, send_envelope, NULL);

sentry_options_set_database_path(options, g_transport_options.outbox_path);
sentry_options_set_transport(
options, sentry_new_function_transport(send_envelope, NULL));
sentry_options_set_debug(options, g_transport_options.debug);
sentry_options_set_dsn(options, (*env)->GetStringUTFChars(env, dsn, 0));
sentry_init(options);
Expand Down
2 changes: 1 addition & 1 deletion sentry-native-sample/src/main/cpp/native-sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern "C" {

JNIEXPORT void JNICALL Java_io_sentry_nativesample_NativeSample_message(JNIEnv *env, jclass cls) {
__android_log_print(ANDROID_LOG_WARN, TAG, "About to crash.");
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending message.");
sentry_value_t event = sentry_value_new_message_event(
/* level */ SENTRY_LEVEL_INFO,
/* logger */ "custom",
Expand Down
1 change: 1 addition & 0 deletions sentry-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ android {
} else {
"sentry-native"
}
println("sentry-sample: $sentryNativeSrc")

cmake {
arguments.add(0, "-DANDROID_STL=c++_static")
Expand Down
2 changes: 1 addition & 1 deletion sentry-sample/src/main/cpp/native-sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ JNIEXPORT void JNICALL Java_io_sentry_sample_NativeSample_crash(JNIEnv *env, jcl
}

JNIEXPORT void JNICALL Java_io_sentry_sample_NativeSample_message(JNIEnv *env, jclass cls) {
__android_log_print(ANDROID_LOG_WARN, TAG, "About to crash.");
__android_log_print(ANDROID_LOG_WARN, TAG, "Sending message.");
sentry_value_t event = sentry_value_new_message_event(
/* level */ SENTRY_LEVEL_INFO,
/* logger */ "custom",
Expand Down

0 comments on commit 9e19eaf

Please sign in to comment.