Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit ceac307

Browse files
Failed to verify bitcode in TNSMLKitCamera.framework/TNSMLKitCamera #954
1 parent 5fb847e commit ceac307

File tree

9 files changed

+9
-23
lines changed

9 files changed

+9
-23
lines changed

demo-ng/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"nativescript-angular": "^6.1.0",
2626
"nativescript-camera": "^4.0.2",
2727
"nativescript-imagepicker": "~6.0.4",
28-
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.5.tgz",
28+
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.6.tgz",
2929
"nativescript-theme-core": "~1.0.4",
3030
"reflect-metadata": "~0.1.10",
3131
"rxjs": "~6.0.0 || >=6.1.0",

demo-push/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
},
1111
"dependencies": {
12-
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.3.tgz",
12+
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.6.tgz",
1313
"nativescript-theme-core": "^1.0.4",
1414
"nativescript-unit-test-runner": "^0.3.4",
1515
"tns-core-modules": "~4.2.0"

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"firebase-functions": "^2.0.5",
13-
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.3.tgz",
13+
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.6.tgz",
1414
"nativescript-theme-core": "^1.0.4",
1515
"nativescript-unit-test-runner": "^0.3.4",
1616
"tns-core-modules": "^4.2.1"

src/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-plugin-firebase",
3-
"version": "7.1.5",
3+
"version": "7.1.6",
44
"description": "Fire. Base. Firebase!",
55
"main": "firebase",
66
"typings": "index.d.ts",
@@ -43,6 +43,7 @@
4343
"demo-ng.ios": "npm run preparedemo-ng && cd ../demo-ng && tns run ios",
4444
"demo-ng.ios.bundled": "npm run preparedemo-ng && cd ../demo-ng && tns run ios --bundle",
4545
"demo-push.ios": "npm run preparedemo-push && cd ../demo-push && tns run ios",
46+
"demo-push.ios.release": "npm run preparedemo-push && cd ../demo-push && tns build ios --release --for-device",
4647
"demo.android": "npm run preparedemo && cd ../demo && rimraf platforms/android && tns run android",
4748
"demo.android.linked": "npm run tsc && cd ../demo && tns run android --syncAllFiles",
4849
"demo-ng.android": "npm run preparedemo-ng && cd ../demo-ng && tns run android",
Binary file not shown.
Binary file not shown.

src/platforms/ios_lib/TNSMLKitCamera/TNSMLKitCamera.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
DYLIB_COMPATIBILITY_VERSION = 1;
289289
DYLIB_CURRENT_VERSION = 1;
290290
DYLIB_INSTALL_NAME_BASE = "@rpath";
291+
ENABLE_BITCODE = NO;
291292
INFOPLIST_FILE = TNSMLKitCamera/Info.plist;
292293
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
293294
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -310,6 +311,7 @@
310311
DYLIB_COMPATIBILITY_VERSION = 1;
311312
DYLIB_CURRENT_VERSION = 1;
312313
DYLIB_INSTALL_NAME_BASE = "@rpath";
314+
ENABLE_BITCODE = NO;
313315
INFOPLIST_FILE = TNSMLKitCamera/Info.plist;
314316
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
315317
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";

src/platforms/ios_lib/TNSMLKitCamera/TNSMLKitCamera/TNSMLKitCameraView.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,20 @@ + (NSArray * _Nullable)resizeImage:(nonnull UIImage *)image {
3131
NSUInteger imageWidth = CGImageGetWidth(cgImage);
3232

3333
if (imageWidth <= 0) {
34-
NSLog(@">>> imageWidth <= 0");
3534
return nil;
3635
}
3736

3837
NSUInteger bytesPerRow = CGImageGetBytesPerRow(cgImage);
3938
NSUInteger oldComponentsCount = bytesPerRow / imageWidth;
4039

4140
if (oldComponentsCount < newComponentsCount) {
42-
NSLog(@">>> oldComponentsCount < newComponentsCount");
4341
return nil;
4442
}
4543

4644
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
4745

4846
int newWidth = (int)floor(size.width);
49-
NSLog(@">>> %d", newWidth);
5047
int newHeight = (int)floor(size.height);
51-
NSLog(@">>> %d", newHeight);
5248

5349
int dataSize = newWidth * newHeight * (int)oldComponentsCount *(int)batchSize;
5450

@@ -66,12 +62,9 @@ + (NSArray * _Nullable)resizeImage:(nonnull UIImage *)image {
6662
// unsigned char *sourceData = (unsigned char*)calloc(sourceHeight * sourceWidth * 4, sizeof(unsigned char));
6763

6864
CGContextRef context = CGBitmapContextCreate(NULL, newWidth, newHeight, bitsPerComponent, newBytesPerRow, colorSpace, kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast);
69-
NSLog(@">>> context");
7065

71-
// TODO THIS line crashes because cgImage is probably not retained
7266
CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, newWidth, newHeight), cgImage);
7367

74-
NSLog(@">>> context drawn");
7568
CGContextRelease(context);
7669

7770
NSMutableArray * scaledImageData = [NSMutableArray new];
@@ -80,7 +73,7 @@ + (NSArray * _Nullable)resizeImage:(nonnull UIImage *)image {
8073
for (int xCoordinate = 0; xCoordinate < newWidth; xCoordinate++) {
8174
NSMutableArray * pixelArray = [NSMutableArray new];
8275
for (int component = 0; component < newComponentsCount; component++) {
83-
int inputIndex = (yCoordinate * newWidth * oldComponentsCount) + (xCoordinate * oldComponentsCount + component);
76+
long inputIndex = (yCoordinate * newWidth * oldComponentsCount) + (xCoordinate * oldComponentsCount + component);
8477
unsigned char pixel = imageData[inputIndex];
8578
if (isQuantized) {
8679
NSLog(@"pixel %hhu", (unsigned char) pixel);

src/platforms/ios_lib/TNSMLKitCamera/TNSMLKitCamera/UIImage+TNSMLKitCamera.m

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
@implementation UIImage (TNSMLKitCamera)
55

66
- (NSArray * _Nullable)scaleImageDataWith:(CGSize)size componentsCount:(NSInteger)newComponentsCount batchSize:(NSInteger)batchSize isQuantized:(BOOL)isQuantized {
7-
NSLog(@">>> scaleImageDataWith");
87

98
// CGImageRef cgImage = CGImageRetain([self CGImage]);
109

@@ -15,27 +14,22 @@ - (NSArray * _Nullable)scaleImageDataWith:(CGSize)size componentsCount:(NSIntege
1514
NSUInteger imageWidth = CGImageGetWidth(cgImage);
1615

1716
if (imageWidth <= 0) {
18-
NSLog(@">>> imageWidth <= 0");
1917
return nil;
2018
}
2119

2220
NSUInteger bytesPerRow = CGImageGetBytesPerRow(cgImage);
2321
NSUInteger oldComponentsCount = bytesPerRow / imageWidth;
2422

2523
if (oldComponentsCount < newComponentsCount) {
26-
NSLog(@">>> oldComponentsCount < newComponentsCount");
2724
return nil;
2825
}
2926

3027
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
3128

3229
int newWidth = (int)floor(size.width);
33-
NSLog(@">>> %d", newWidth);
3430
int newHeight = (int)floor(size.height);
35-
NSLog(@">>> %d", newHeight);
3631

3732
int dataSize = newWidth * newHeight * (int)oldComponentsCount *(int)batchSize;
38-
NSLog(@">>> %lu", (unsigned long) dataSize);
3933

4034
size_t bitsPerComponent = CGImageGetBitsPerComponent(cgImage);
4135
size_t newBytesPerRow = oldComponentsCount * newWidth;
@@ -51,12 +45,9 @@ - (NSArray * _Nullable)scaleImageDataWith:(CGSize)size componentsCount:(NSIntege
5145
// unsigned char *sourceData = (unsigned char*)calloc(sourceHeight * sourceWidth * 4, sizeof(unsigned char));
5246

5347
CGContextRef context = CGBitmapContextCreate(NULL, newWidth, newHeight, bitsPerComponent, newBytesPerRow, colorSpace, kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast);
54-
NSLog(@">>> context");
5548

5649
CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, newWidth, newHeight), cgImage);
57-
NSLog(@">>> context drawn");
5850
CGContextRelease(context);
59-
NSLog(@">>> context released");
6051
// CGImageRelease(cgImage);
6152
// NSLog(@">>> CGImageRelease");
6253

@@ -66,10 +57,9 @@ - (NSArray * _Nullable)scaleImageDataWith:(CGSize)size componentsCount:(NSIntege
6657
for (int xCoordinate = 0; xCoordinate < newWidth; xCoordinate++) {
6758
NSMutableArray * pixelArray = [NSMutableArray new];
6859
for (int component = 0; component < newComponentsCount; component++) {
69-
int inputIndex = (yCoordinate * newWidth * oldComponentsCount) + (xCoordinate * oldComponentsCount + component);
60+
long inputIndex = (yCoordinate * newWidth * oldComponentsCount) + (xCoordinate * oldComponentsCount + component);
7061
unsigned char pixel = imageData[inputIndex];
7162
if (isQuantized) {
72-
NSLog(@"pixel %hhu", (unsigned char) pixel);
7363
[pixelArray addObject: [NSNumber numberWithUnsignedChar:pixel]];
7464
} else {
7565
// Convert pixel values from [0, 255] to [-1, 1].

0 commit comments

Comments
 (0)