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

iOS-Build fails with imagepicker plugin 2.5.0 for Android/iOS with AppBuilder #69

Closed
felixkrautschuk opened this issue Feb 9, 2017 · 4 comments

Comments

@felixkrautschuk
Copy link

Hi,

I am not able to build our app for the iOS platform anymore with the latest imagepicker-plugin.
Here is my work environment:

  • Telerik AppBuilder 3.6.7
  • NativeScript 2.5.0
  • nativescript-imagepicker 2.4.1
  • iPhone 4S with iOS 8.4.1

This is the content of build.log:

Project "fanfiktion.tmp.proj" (default targets):
ios Build Tooling revision 2017.01.26.3r
Build Tooling Hostname administrators-mac-78.local
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: [xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/AFNetworking'
[xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/GCDWebServer'
[xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/KSCrash'
[xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/AFNetworking'
[xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/GCDWebServer'
[xcode-build] ld: directory not found for option '-F/tmp/builds/dUcvLSAoPD7CbENLwb/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/KSCrash'
Error: 2017-02-09 10:46:25.645 xcodebuild[98677:11823113] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/kn/dw3_mg3d5rv8b69hhphnnv9w0000gp/T/NativeScript250_2017-02-09_10-46-25.644.xcdistributionlogs'.
1.2.840.113635.100.1.61
2017-02-09 10:46:37.603 xcodebuild[98677:11823113] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7ff841585140>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
** EXPORT FAILED **
Error: 'Build failed with error code 2'
Done building project "fanfiktion.tmp.proj" -- FAILED.

I hope this helps you to fix this issue. The build succeeded with the previous version of this plugin: 2.4.0.
Please tell me if you need any other details to find the reason for this issue.

Best regards,
felix

@felixkrautschuk felixkrautschuk changed the title iOS-Build fails for with imagepicker plugin 2.4.1 iOS-Build fails with imagepicker plugin 2.4.1 Feb 9, 2017
@tsonevn
Copy link
Contributor

tsonevn commented Feb 13, 2017

Hi @felix-idf ,
I am still unable to reproduce the exact problem with freezing the screen after selecting an image from the gallery. We will research further this issue and will provide some more info about this behavior.

In the meantime you could update your node to the latest available LTS version 6.9.5 and to build again the app, while using AppBuilder CLI.

This issue could be also related to the way you are getting the image. The image-picker will return an array from imageAssets and getImage() should be used to get the imageSource and to save the image in a temporary file in the app. For example:

asset.getImage().then(function(imagesource){
                    let folder = fs.knownFolders.documents();
                    let path = fs.path.join(folder.path, "Test"+counter+".png");
                    let saved = imagesource.saveToFile(path, "png");
                    
                    if(saved){
                        var task = sendImages("Image"+counter+".png", path);
                        var item = new observable.Observable();
                        item.set("thumb", imagesource);
                        item.set("uri", "Test"+counter+".png");
                        item.set("uploadTask", task);

                        imageItems.push(item);
                    }
                    counter++;
                })

You could also review the full sample project here and logic, which has been used in the app to get and send the image to the server.

@felixkrautschuk
Copy link
Author

Hi @tsonevn ,
I was on vacation, so sorry for the late response.

Actually, this issue was created, because of my troubles building the app with the latest imagepicker plugin.
According to the problem with freezing the screen after selecting an image, I will change the way I am getting the image as soon as possible.

But I still have trouble building the app for Android and iOS with the imagepicker 2.5.0 and 2.5.1.

Once again my testing environment:

  • NativeScript 2.5.0
  • tns-core-modules 2.5.1
  • imagepicker 2.5.1 (also tested 2.5.0)
  • Telerik AppBuilder 3.6.7

I noticed that the build works fine for Android when using the local NativeScript CLI (I cannot test for iOS, because we work on Windows operationg system).
If you think that this is absolutely AppBuilder-related and you do not feel responsible for it, then I am going to create an issue in the Telerik AppBuilder Forums with a link to this one here.

Here is the output from build.log for Android:

Project "fanfiktion.tmp.proj" (default targets):
android Build Tooling revision 2017.01.26.3r
Build Tooling Hostname d1ac1083b85d
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: FAILURE:
Warning: Build failed with an exception.
What went wrong:
Warning: Execution failed for task ':processF0F1F2F3F4F5F6F7DebugResources'.
Warning: > Error: more than one library with package name 'com.telerik.android.common'
Warning: * Try:
Warning: Run with
Warning: --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Warning: Command /tmp/builds/3bReAyVpiHybxpvlFk/app/output/NativeScript250/platforms/android/gradlew failed with exit code 1
Error: Build failed during execution
Error: 'Build failed with error code 127'
Done building project "fanfiktion.tmp.proj" -- FAILED.

And for iOS:

Project "fanfiktion.tmp.proj" (default targets):
ios Build Tooling revision 2017.01.26.3r
Build Tooling Hostname administrators-mac-14.local
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: Support for Node.js ^4.0.0 is deprecated and will be removed in the next release of NativeScript. Please, upgrade to the latest Node.js LTS version.
Warning: [xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/AFNetworking'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/GCDWebServer'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/IQKeyboardManager'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/KSCrash'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/MNFloatingActionButton'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/SSSnackbar'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/AFNetworking'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/GCDWebServer'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/IQKeyboardManager'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/KSCrash'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/MNFloatingActionButton'
[xcode-build] ld: directory not found for option '-F/tmp/builds/F99wChsXKHbphf7oZd/app/output/NativeScript250/platforms/ios/DerivedData/Build/Intermediates/ArchiveIntermediates/NativeScript250/BuildProductsPath/Debug-iphoneos/SSSnackbar'
Error: 2017-02-23 12:51:41.201 xcodebuild[61844:40453880] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/t9/xhtxg7912rs31d0f53pslcgh0000gp/T/NativeScript250_2017-02-23_12-51-41.199.xcdistributionlogs'.
1.2.840.113635.100.1.61
2017-02-23 12:51:57.414 xcodebuild[61844:40453880] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fbb1d4bc6a0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
** EXPORT FAILED **
Error: 'Build failed with error code 2'
Done building project "fanfiktion.tmp.proj" -- FAILED.

Hoe you can figure out what is going wrong here.

Thanks in advance and best regards,

Felix

@felixkrautschuk felixkrautschuk changed the title iOS-Build fails with imagepicker plugin 2.4.1 iOS-Build fails with imagepicker plugin 2.5.0 for Android/iOS with AppBuilder Feb 23, 2017
@felixkrautschuk
Copy link
Author

As I already commented in my original post, the problem with freezing the screen after selecting an image from the gallery is solved. I used a wrong way of getting an image from the picker.

The remaining problem is that the build fails when I try to build the app with the imagepicker plugin 2.5.1 within the AppBuilder CLI. So it seems to be not a general problem with the plugin.

@tsonevn
Copy link
Contributor

tsonevn commented Feb 27, 2017

Hi @felix-idf,
In my further research, I found that this behavior could be related due to a problem with installation one of the plugin's dependencies.
nativescript-imagepicker plugin uses nativescirpt-telerik-ui and its RadListView component to display the images from the gallery.

While adding nativescript-imagepicker version 2.5.1, nativescirpt-telerik-ui has not been installed properly, which could cause this issue.

To fix this, you could add nativescript-imagepicker manually with appbuilder plugin add nativescript-telerik-ui to add again the latest available version of nativescript-imagepicker version 2.5.1. then try to rebuild the app.

package.json

{
  "dependencies": {
    "nativescript-imagepicker": "2.5.1",
    "nativescript-telerik-ui": "1.6.1",
    "tns-core-modules": "2.5.0"
  },
  "devDependencies": {}
}

Hope this helps.

@tsonevn tsonevn closed this as completed Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants