Skip to content

Commit 8f46d41

Browse files
Merge pull request #280 from dynamsoft-docs/preview
Preview
2 parents 4ef999a + 3f8b450 commit 8f46d41

File tree

4 files changed

+154
-53
lines changed

4 files changed

+154
-53
lines changed

_includes/sidelist-programming/programming-maui.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,8 @@
151151
<li lang="maui"><a href="{{ site.dbr_maui }}release-notes/maui-10.html" class="otherLinkColour">10.x</a></li>
152152
</ul>
153153
</li>
154+
<li lang="maui"><a class="otherLinkColour">FAQ</a>
155+
<ul lang="maui">
156+
<li lang="maui"><a href="{{ site.dbr_maui }}faq/common-environment-issues.html" class="otherLinkColour">Common Environment Issues</a></li>
157+
</ul>
158+
</li>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
layout: default-layout
3+
title: Common Environment Issues - Dynamsoft Barcode Reader for MAUI
4+
description: This page introduce how to solve common environment issues when using Dynamsoft Barcode Reader MAUI SDK.
5+
keywords: FAQ, maui, common environment issues
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Common Environment Issues
12+
13+
## Failed to install
14+
15+
You might get "Could not find a part of the path 'C:\Users\admin\.nuget\packages\dynamsoft.imageprocessing.ios\2.2.300\lib\net7.0-ios16.1\Dynamsoft.ImageProcessing.iOS.resources\DynamsoftImageProcessing.xcframework\ios-arm64\dSYMs\DynamsoftImageProcessing.framework.dSYM\Contents\Resources\DWARF\DynamsoftImageProcessing'" error when installing the package on a **Windows** PC. That's because the Windows system have a limitation of 260 characters in the path. There are 2 ways to solve this:
16+
17+
### Exclude the iOS platform from the project
18+
19+
The long path belongs to the iOS xcframework of the package. If you only want to run Android on Windows, you can use this solution.
20+
21+
Remove iOS platform from you project via the project file.
22+
23+
```xml
24+
<PropertyGroup>
25+
<!-- Remove iOS and desktop platforms from your TargetFrameworks. -->
26+
<!-- <TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks> -->
27+
<TargetFrameworks>net8.0-android</TargetFrameworks>
28+
29+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
30+
<!-- Remove the iOS platforms from the SupportedOSPlatformVersion. -->
31+
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion> -->
32+
</PropertyGroup>
33+
```
34+
35+
### Add the library via project file instead of **Nuget Package Manager**
36+
37+
Adding the library via project file can ignore the 260 character limitation but you need some additional steps to complete the installation.
38+
39+
```xml
40+
<Project Sdk="Microsoft.NET.Sdk">
41+
...
42+
<ItemGroup>
43+
...
44+
<PackageReference Include="Dynamsoft.BarcodeReaderBundle.Maui" Version="10.2.1101" />
45+
</ItemGroup>
46+
</Project>
47+
```
48+
49+
Open the **Package Manager Console** and run the following commands:
50+
51+
```bash
52+
dotnet build
53+
```
54+
55+
## error NU1202: Package Dynamsoft.BarcodeReaderBundle.Maui 10.2.1101 is not compatible with net8.0-windows10.0.19041
56+
57+
You may find similar issues like:
58+
59+
- "not compatible with net8.0-windows10.0.19041"
60+
- "not compatible with net8.0-maccatalyst17.2"
61+
62+
Currently, `Dynamsoft.BarcodeReaderBundle.Maui` library doesn't support desktop environment. You have to remove them from your project.
63+
64+
```xml
65+
<PropertyGroup>
66+
<!-- Remove ";net8.0-maccatalyst" from your TargetFrameworks. -->
67+
<!-- <TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks> -->
68+
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
69+
<!-- Remove "net8.0-windows10.0.19041.0" from your TargetFrameworks. -->
70+
<!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks> -->
71+
72+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
73+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
74+
<!-- Remove the unsupported platforms from the SupportedOSPlatformVersion. -->
75+
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion> -->
76+
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
77+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
78+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> -->
79+
</PropertyGroup>
80+
```

programming/maui/user-guide.md

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ noTitleIndex: true
1414
## Table of Contents
1515

1616
- [Getting Started with MAUI](#getting-started-with-maui)
17-
- [Table of Contents](#table-of-contents)
18-
- [System Requirements](#system-requirements)
19-
- [.Net](#net)
20-
- [Android](#android)
21-
- [iOS](#ios)
22-
- [Installation](#installation)
23-
- [Build Your Barcode Scanner App](#build-your-barcode-scanner-app)
24-
- [Set up Development Environment](#set-up-development-environment)
25-
- [Initialize the Project](#initialize-the-project)
26-
- [Visual Studio](#visual-studio)
27-
- [Visual Studio for Mac](#visual-studio-for-mac)
28-
- [Include the Library](#include-the-library)
29-
- [Initialize MauiProgram](#initialize-mauiprogram)
30-
- [License Activation](#license-activation)
31-
- [Add the CameraView in the Main Page](#add-the-cameraview-in-the-main-page)
32-
- [Open the Camera and Start Barcode Decoding](#open-the-camera-and-start-barcode-decoding)
33-
- [Obtaining Barcode Results](#obtaining-barcode-results)
34-
- [Add Camera Permission](#add-camera-permission)
35-
- [Run the Project](#run-the-project)
36-
- [Customizing the Barcode Reader](#customizing-the-barcode-reader)
37-
- [Switching Preset Templates](#switching-preset-templates)
38-
- [Configuring the SimplifiedBarcodeReaderSettings](#configuring-the-simplifiedbarcodereadersettings)
39-
- [Customizing the Scan Region](#customizing-the-scan-region)
40-
- [Licensing](#licensing)
17+
- [Table of Contents](#table-of-contents)
18+
- [System Requirements](#system-requirements)
19+
- [.Net](#net)
20+
- [Android](#android)
21+
- [iOS](#ios)
22+
- [Installation](#installation)
23+
- [Build Your Barcode Scanner App](#build-your-barcode-scanner-app)
24+
- [Set up Development Environment](#set-up-development-environment)
25+
- [Initialize the Project](#initialize-the-project)
26+
- [Visual Studio](#visual-studio)
27+
- [Visual Studio for Mac](#visual-studio-for-mac)
28+
- [Include the Library](#include-the-library)
29+
- [Initialize MauiProgram](#initialize-mauiprogram)
30+
- [License Activation](#license-activation)
31+
- [Add the CameraView in the Main Page](#add-the-cameraview-in-the-main-page)
32+
- [Open the Camera and Start Barcode Decoding](#open-the-camera-and-start-barcode-decoding)
33+
- [Obtaining Barcode Results](#obtaining-barcode-results)
34+
- [Add Camera Permission](#add-camera-permission)
35+
- [Run the Project](#run-the-project)
36+
- [Customizing the Barcode Reader](#customizing-the-barcode-reader)
37+
- [Switching Preset Templates](#switching-preset-templates)
38+
- [Configuring the SimplifiedBarcodeReaderSettings](#configuring-the-simplifiedbarcodereadersettings)
39+
- [Customizing the Scan Region](#customizing-the-scan-region)
40+
- [Licensing](#licensing)
4141

4242
## System Requirements
4343

@@ -60,11 +60,33 @@ noTitleIndex: true
6060

6161
## Installation
6262

63+
### Visual Studio for Mac
64+
6365
In the **NuGet Package Manager>Manage Packages for Solution** of your project, search for **Dynamsoft.BarcodeReaderBundle.Maui**. Select it and click **install**.
6466

65-
> Note: If you are developing Android on Visual Studio Windows, you have to mannually exclude iOS and Windows platforms. Otherwise, the package installation will be failed ("Could not find a part of the path" error).
67+
### Visual Studio for Windows
6668

67-
![Exclude iOS and Windows from targets](../assets/maui-exclude.png)
69+
You have to Add the library via the project file and do some additional steps to complete the installation.
70+
71+
1. Add the library in the project file:
72+
73+
```xml
74+
<Project Sdk="Microsoft.NET.Sdk">
75+
...
76+
<ItemGroup>
77+
...
78+
<PackageReference Include="Dynamsoft.BarcodeReaderBundle.Maui" Version="10.2.1101" />
79+
</ItemGroup>
80+
</Project>
81+
```
82+
83+
2. Open the **Package Manager Console** and run the following commands:
84+
85+
```bash
86+
dotnet build
87+
```
88+
89+
> Note: Windows system have a limitation of 260 characters in the path. If you don't use console to install the package, you will receive error "Could not find a part of the path 'C:\Users\admin\.nuget\packages\dynamsoft.imageprocessing.ios\2.2.300\lib\net7.0-ios16.1\Dynamsoft.ImageProcessing.iOS.resources\DynamsoftImageProcessing.xcframework\ios-arm64\dSYMs\DynamsoftImageProcessing.framework.dSYM\Contents\Resources\DWARF\DynamsoftImageProcessing'"
6890

6991
## Build Your Barcode Scanner App
7092

programming/objectivec-swift/user-guide.md

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ Add the SDK to your new project. There are several ways to do this, all of which
100100

101101
### Initialize the License
102102

103-
Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put the license activation code in the **AppDelegate** file.
103+
Dynamsoft Barcode Reader needs a valid license to work.
104104

105-
1. Implement the protocol `LicenseVerificationListener` through class **AppDelegate**:
105+
1. Implement the protocol `LicenseVerificationListener` through class **ViewController**:
106106

107107
<div class="sample-code-prefix"></div>
108108
>- Objective-C
@@ -111,13 +111,12 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
111111
>1.
112112
```objc
113113
#import <DynamsoftLicense/DynamsoftLicense.h>
114-
@interface AppDelegate ()<DSLicenseVerificationListener>
114+
@interface ViewController () <DSLicenseVerificationListener>
115115
```
116116
2.
117117
```swift
118118
import DynamsoftLicense
119-
@main
120-
class AppDelegate: LicenseVerificationListener
119+
class ViewController: UIViewController, LicenseVerificationListener
121120
```
122121

123122
2. Add the following code to initialize the license in method `application:didFinishLaunchingWithOptions:` and receive the callback message :
@@ -128,33 +127,26 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
128127
>
129128
>1.
130129
```objc
131-
@implementation AppDelegate
130+
- (void)setLicense {
131+
[DSLicenseManager initLicense:@"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" verificationDelegate:self];
132+
}
132133
- (void)onLicenseVerified:(BOOL)isSuccess error:(nullable NSError *)error {
133134
if (!isSuccess && error != nil) {
134-
NSLog(@"%@", error);
135+
NSLog(@"error: %@", error);
135136
}
136137
}
137-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *) launchOptions {
138-
/**Override point for customization after application launch.*/
139-
[DSLicenseManager initLicense:@"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" verificationDelegate:self];
140-
return YES;
141-
}
142138
```
143139
2.
144140
```swift
145-
class AppDelegate: UIResponder, UIApplicationDelegate, LicenseVerificationListener {
146-
func onLicenseVerified(_ isSuccess: Bool, error: Error?) {
147-
if !isSuccess {
148-
if let error = error {
149-
print("\(error.localizedDescription)")
150-
}
141+
func setLicense() {
142+
LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", verificationDelegate: self)
143+
}
144+
func onLicenseVerified(_ isSuccess: Bool, error: Error?) {
145+
if !isSuccess {
146+
if let error = error {
147+
print("\(error.localizedDescription)")
151148
}
152149
}
153-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
154-
/**Override point for customization after application launch.*/
155-
LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", verificationDelegate: self)
156-
return true
157-
}
158150
}
159151
```
160152

@@ -196,7 +188,7 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
196188
>
197189
>1.
198190
```objc
199-
@interface ViewController ()
191+
@interface ViewController () <DSLicenseVerificationListener>
200192
@property (nonatomic, strong) DSCameraView *cameraView;
201193
@property (nonatomic, strong) DSCameraEnhancer *dce;
202194
@end
@@ -234,7 +226,7 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
234226
>
235227
>1.
236228
```objc
237-
@interface ViewController ()
229+
@interface ViewController () <DSLicenseVerificationListener>
238230
@property (nonatomic, strong) DSCaptureVisionRouter *cvr;
239231
@end
240232
...
@@ -266,7 +258,7 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
266258
>1.
267259
```objc
268260
/**Add CapturedResultReceiver to your ViewController.*/
269-
@interface ViewController () <DSCapturedResultReceiver>
261+
@interface ViewController () <DSLicenseVerificationListener, DSCapturedResultReceiver>
270262
...
271263
- (void)setUpDCV {
272264
...
@@ -300,7 +292,7 @@ Dynamsoft Barcode Reader needs a valid license to work. It is recommended to put
300292
2.
301293
```swift
302294
/**Add CapturedResultReceiver to your ViewController.*/
303-
class ViewController: UIViewController, CapturedResultReceiver {
295+
class ViewController: UIViewController, CapturedResultReceiver, LicenseVerificationListener {
304296
...
305297
func setUpDCV() {
306298
...
@@ -345,6 +337,7 @@ Now that all of the main functions are defined and configured, let's finish thin
345337
- (void)viewDidLoad {
346338
[super viewDidLoad];
347339
/**Do any additional setup after loading the view.*/
340+
[self setLicense];
348341
[self setUpCamera];
349342
[self setUpDCV];
350343
}
@@ -369,6 +362,7 @@ Now that all of the main functions are defined and configured, let's finish thin
369362
override func viewDidLoad() {
370363
super.viewDidLoad()
371364
/**Do any additional setup after loading the view.*/
365+
setLicense()
372366
setUpCamera()
373367
setUpDCV()
374368
}

0 commit comments

Comments
 (0)