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

fix: lib crashing when proguard is enabled #93

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ android {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
consumerProguardFiles "proguard-rules.pro"
}
buildTypes {
release {
Expand Down
1 change: 1 addition & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class dev.matinzd.healthconnect.records.** { *; }
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ react {
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
def enableProguardInReleaseBuilds = true

/**
* The preferred build flavor of JavaScriptCore (JSC)
Expand Down
30 changes: 20 additions & 10 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ export default function App() {
startTime: getLastWeekDate().toISOString(),
endTime: getTodayDate().toISOString(),
},
]).then((ids) => {
console.log('Records inserted ', { ids });
});
])
.then((ids) => {
console.log('Records inserted ', { ids });
})
.catch((err) => {
console.error('Error inserting records ', { err });
});
};

const readSampleData = () => {
Expand All @@ -71,17 +75,23 @@ export default function App() {
startTime: getLastTwoWeeksDate().toISOString(),
endTime: getTodayDate().toISOString(),
},
}).then((result) => {
console.log('Retrieved records: ', JSON.stringify({ result }, null, 2));
});
})
.then((result) => {
console.log('Retrieved records: ', JSON.stringify({ result }, null, 2));
})
.catch((err) => {
console.error('Error reading records ', { err });
});
};

const readSampleDataSingle = () => {
readRecord('Steps', 'a7bdea65-86ce-4eb2-a9ef-a87e6a7d9df2').then(
(result) => {
readRecord('Steps', 'a7bdea65-86ce-4eb2-a9ef-a87e6a7d9df2')
.then((result) => {
console.log('Retrieved record: ', JSON.stringify({ result }, null, 2));
}
);
})
.catch((err) => {
console.error('Error reading record ', { err });
});
};

const aggregateSampleData = () => {
Expand Down
Loading