Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Added gradle configuration tu enable APK split by abi to avoid java.l…
Browse files Browse the repository at this point in the history
…ang.UnsatisfiedLinkError
  • Loading branch information
samueleperricone committed Apr 27, 2018
1 parent db7a117 commit a7ef048
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
28 changes: 28 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,34 @@ android {
}
}

//// DE-COMMENT THIS IF YOU HAVE ISSUES AT RUNTIME, CRASHING WITH java.lang.UnsatisfiedLinkError

//android {
//
// splits {
//
// // Configures multiple APKs based on ABI.
// abi {
//
// // Enables building multiple APKs per ABI.
// enable true
//
// // By default all ABIs are included, so use reset() and include to specify that we only
// // want APKs for x86, armeabi-v7a, and mips.
//
// // Resets the list of ABIs that Gradle should create APKs for to none.
// reset()
//
// // Specifies a list of ABIs that Gradle should create APKs for.
// include 'armeabi-v7a', 'x86', 'x86_64' // de-comment this to test on emulator
// // include 'armeabi-v7a'
//
// // Specifies that we do not want to also generate a universal APK that includes all ABIs.
// universalApk false
// }
// }
//}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/empatica/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ private void initEmpaticaDeviceManager() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_COARSE_LOCATION }, REQUEST_PERMISSION_ACCESS_COARSE_LOCATION);
} else {
// Create a new EmpaDeviceManager. MainActivity is both its data and status delegate.
deviceManager = new EmpaDeviceManager(getApplicationContext(), this, this);

if (TextUtils.isEmpty(EMPATICA_API_KEY)) {
new AlertDialog.Builder(this)
Expand All @@ -179,6 +177,10 @@ public void onClick(DialogInterface dialog, int which) {
.show();
return;
}

// Create a new EmpaDeviceManager. MainActivity is both its data and status delegate.
deviceManager = new EmpaDeviceManager(getApplicationContext(), this, this);

// Initialize the Device Manager using your API key. You need to have Internet access at this point.
deviceManager.authenticateWithAPIKey(EMPATICA_API_KEY);
}
Expand Down

0 comments on commit a7ef048

Please sign in to comment.