fix: import image failure on Android

This commit is contained in:
Tom Fong 2023-07-15 17:35:07 +08:00
parent 0a798516d1
commit 244ee01e2b
9 changed files with 23 additions and 14 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>

View file

@ -11,7 +11,7 @@
</map> </map>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="temurin-11" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View file

@ -7,8 +7,8 @@ android {
applicationId "com.tomfong.simpleqr" applicationId "com.tomfong.simpleqr"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 4000000 versionCode 4000100
versionName "4.0.0" versionName "4.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions { aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

View file

@ -39,6 +39,7 @@
</application> </application>
<!-- Permissions --> <!-- Permissions -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" />

View file

@ -399,7 +399,7 @@
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.0.0; MARKETING_VERSION = 4.0.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.tomfong.simpleqr; PRODUCT_BUNDLE_IDENTIFIER = com.tomfong.simpleqr;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -422,7 +422,7 @@
INFOPLIST_FILE = App/Info.plist; INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.0.0; MARKETING_VERSION = 4.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.tomfong.simpleqr; PRODUCT_BUNDLE_IDENTIFIER = com.tomfong.simpleqr;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Simple QR"; PROVISIONING_PROFILE_SPECIFIER = "Simple QR";

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "simple-qr", "name": "simple-qr",
"version": "4.0.0", "version": "4.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "simple-qr", "name": "simple-qr",
"version": "4.0.0", "version": "4.0.1",
"dependencies": { "dependencies": {
"@angular/animations": "^16.1.3", "@angular/animations": "^16.1.3",
"@angular/cdk": "^16.1.3", "@angular/cdk": "^16.1.3",

View file

@ -1,6 +1,6 @@
{ {
"name": "simple-qr", "name": "simple-qr",
"version": "4.0.0", "version": "4.0.1",
"author": "Tom Fong", "author": "Tom Fong",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",

View file

@ -96,6 +96,14 @@ export class ImportImagePage {
}); });
await alert.present(); await alert.present();
} }
},
async err => {
getPictureLoading.dismiss();
if (this.env.debugMode === 'on') {
await Toast.show({ text: 'Err when Camera.requestPermissions: ' + JSON.stringify(err), position: "bottom", duration: "long" })
} else {
Toast.show({ text: 'Unknown Error', position: "bottom", duration: "short" })
}
} }
); );
} }

View file

@ -31,7 +31,7 @@ export declare type ResultPageButtonsType = 'detailed' | 'icon-only';
}) })
export class EnvService { export class EnvService {
public appVersionNumber: string = '4.0.0'; public appVersionNumber: string = '4.0.1';
public startPage: TabPageType = "/tabs/scan"; public startPage: TabPageType = "/tabs/scan";
public historyPageStartSegment: HistoryPageSegmentType = 'history'; public historyPageStartSegment: HistoryPageSegmentType = 'history';
@ -125,10 +125,10 @@ export class EnvService {
public readonly KEY_SHOW_OPEN_FOOD_FACTS_BUTTON = "showOpenFoodFactsButton"; public readonly KEY_SHOW_OPEN_FOOD_FACTS_BUTTON = "showOpenFoodFactsButton";
public readonly KEY_AUTO_EXIT_MIN = "autoExitAppMin"; public readonly KEY_AUTO_EXIT_MIN = "autoExitAppMin";
public readonly KEY_ANDROID_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40000"; public readonly KEY_ANDROID_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40001";
public readonly KEY_IOS_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40000"; public readonly KEY_IOS_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40001";
public readonly KEY_ANDROID_PREV_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v30300"; public readonly KEY_ANDROID_PREV_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40000";
public readonly KEY_IOS_PREV_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v30300"; public readonly KEY_IOS_PREV_NOT_SHOW_UPDATE_NOTES = "not-show-update-notes-v40000";
public readonly APP_FOLDER_NAME: string = 'SimpleQR'; public readonly APP_FOLDER_NAME: string = 'SimpleQR';