CommonJS require function not found running iOS Adhoc/Enterprise - appcelerator

I have an Appcelerator Alloy 6.3.0 iOS app that runs fine on device when running in development.
I packaged the app using my enterprise certificate then build my .ipa and install (and trust) the app on the device.
The app runs fine but then throws an error when attempting to use the commonJS library (pure JS).
try{
var netUtil = require('API');
netUtil.getList($.labelModel.text, myCallBackFunction);
catch(e){
alert('Error: ' + e);
}
The error shown is...
TypeError: undefined is not a function (evaluating 'a.getList(k.label-Model.text,g)' )
The exact same code runs fine on device without changes when running dev certificate with/without liveview.
What may be causing CommonJS require function not found only when running iOS .ipa Adhoc/Enterprise ?

I believe that API name is reserved in Apple's internal apis or could be used by Titanium itself. So you should rename your API.js file to something non-generic like custom_api.js or my_api.js & then try again.
I have had this issue once when I named some lib file to animation.js or something like this (not remember exactly) & figured out that it's always better & safer to use underscore formatting while naming lib files or other js files because internal apis mostly don't use underscore name formatting.

Related

Can not resolve reference: `Windows.Foundation.UniversalApiContract in Android App

I developed a Xamarin Cross Platform application that is working perfectly on Windows but when I try to recompile for Android I get the following error:
Can not resolve reference: `Windows.Foundation.UniversalApiContract
I use the Windows.Foundation.UniversalApiContract reference because of the Windows.Storage class (generate files in internal memory).
I understand that I may have to change the recording method on Android but I can't even get to that stage...
How do I resolve this situation?
Just as ToolmakerSteve said, Windows namespace relies on features that exist only in Windows. The reference should not be in the main .Net Standard library but in the UWP Application.
First, you can move the code to the Windows folder or set the #if Windows around it.
Second, you can write the code for each platform. I found the answer you can refer to Can not resolve reference: Windows.Foundation.UniversalApiContract in Android Application.

Microsoft information protection SDK 1.7.133 - LoadLibrary failed

I saw that the MIP SDK 1.7.133 now has support for .NET Core, and I'm trying to implement Microsoft Information Protection SDK in an Azure Function using .NET Core to label documents in SharePoint (by downloading, labeling and uploading the document again), but when calling MIP.Initialize(MipComponent.File) I'm getting the error below.
Executed 'SensitivityLabeling' (Failed, Id=591fade7-7c51-40b6-b723-56b68af3a66d, Duration=572ms)
System.Private.CoreLib: Exception while executing function: SensitivityLabeling. Microsoft.InformationProtection: LoadLibrary failed for: [F:\<verified-path-to-function>\SensitivityLabelingFunction\bin\Debug\netcoreapp3.1\x64\mip_dotnet.dll].
I followed the quick-start guide before the update which worked well, but when I now update the SDK in the same project and run it with version 1.7.133 it crashes on the same command as my new Azure Function project.
I tried both the plain overload above and with the path using the below example from another question, verifying that the path is correct while debugging, but with the same error.
var path = Path.Combine(
Directory.GetParent(Path.GetDirectoryName(newUri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).FullName,
Environment.Is64BitProcess ? "bin\\x64" : "bin\\x86");
//Initialize Wrapper for File API operations
MIP.Initialize(MipComponent.File, path);
Another semi-related question, is there any other way to label a specific document in SharePoint using code except for the MIP SDK? No other API seems to support applying labels, only changing the actual label settings.
Running it in release mode with version 1.7.133 instead according to Microsoft information protection SDK 1.7.133 - Load library failed issue error seems to work.

Xcode beta generates App cannot be opened because of a problem

Check with the developer to make sure MyApp works with this version of macOS.
After trying to use ASWebAuthenticationSession, when the App receives the callback, it shows the error:
The same error is showed after an attempt to generate the app and open it.
The error you are seeing is because your code is referring to either a non existing library or is pointing to the wrong directory where your code should look for such library. Please check the rpath you are using. Usually, you should place any dylibs inside a Frameworks folder inside your bundle and thus your rpath should start like this: ../Frameworks/InternalAPI.framework (...)

Load external libraries and SDK with appcelerator hyperloop

I'm working on a iOS and Android DVR app with remote controls.
I need to use a third-party library for network communication and video encoding, via hyperloop programming.
At the moment I tried importing the iOS version libraries.
The library consists of a static file libDVR_NET_SDK.a and a "include" folder with several .h header files inside.
I followed the official documentation by creating the references in the appc.js file:
appcelerator.com iOS Hyperloop Programming Guide
module.exports = {
hyperloop: {
ios: {
thirdparty: {
'libDVR_NET_SDK': {
source: 'platform/ios/SDK/include',
header: "platform/ios/SDK/include",
resource: 'platform/ios/SDK'
},
'MediaPlayerLib': {
source: 'platform/ios/MediaPlayerLib/include',
header: "platform/ios/MediaPlayerLib/include",
resource: 'platform/ios/MediaPlayerLib'
}
}
}
}
};
I can not understand how to call the external library from javascript code, at the moment I tried:
var libDVR_NET_SDK = require("libDVR_NET_SDK");
But the following error is generated:
Script Error Couldn't find module: /hyperloop/libdvr_net_sdk/libdvr_net_sdk for architecture: x86_64
Hyperloop docs says : This has been deprecated in Hyperloop 2.2.0 and will be removed in Hyperloop 3.0.0. Place it into your iOS platform directory instead and it will be automatically detected.
So, try putting your library in Project -> app -> platform -> ios folder & it will automatically detect it.
To use in js code, you can try to call it as mentioned in that library docs considering the names to be same as if you were calling them in native iOS.
I found similar to Android here : Hyperloop Android 3rd Party Example. It contains libraries in similar folder & you can check how it's used further in titanium app code.

Unable to convert classes into dex format Unity

Using the google play games services and Admob plugin I cannot seem to get my back to build into an APK and I am receiving the following error message. Any help would be appreciated as I have removed some duplicate files but I am still failing to find why I cannot build my app.
I am using Unity Unity 5.6.1f1 (64-bit).
game services: https://github.com/playgameservices/play-games-plugin-for-unity Ads: https://github.com/unity-plugins/Firebase-Admob-Unity
CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Jack/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzbyb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzbyc;
2 errors; aborting
]
Some Background
When Unity builds your project for Android, it invokes several tools from the Android SDK. As part of that process, it converts all of your native (Java) code for Android into a file format called DEX (Dalvik executable).
All of your Android plugins get built up into a single package using that tool. The problems start when a few plugins have the same compiled Java code (classes) in them. This will cause the DEX tool to fail with an error like the one you're seeing:
Uncaught translation error: java.lang.IllegalArgumentException:
already added: Lcom/google/android/gms/internal/zzbyb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzbyc;
This means that classes with those names were already included in another library, and so they cannot be added again.
Possible Causes
As explained above, this error occurs when you have duplicate plugins in your project; this can happen in different scenarios, here are some examples:
The same plugin is included more than once, under different folders of the project.
The same plugin is included more than once with different versions.
A plugin contains other dependencies "embedded" inside it, but these dependencies are already included in the project in some form.
How To Fix
You should look up duplicate Android plugins in your project and eliminate them (keep only 1 copy). From the error message you posted, the issue here is related to Google play services libraries. You should look into that (libraries named play-services-xxxx.aar).
Paid Help (Shameless Plug)
I provide a professional service for fixing this exact kind of issue. In case you (or anyone else) are not able to resolve such an issue themselves, feel free to contact me and get it solved.
I was facing the same problem after add admob in my project, here are 2 possible solutions:
Go to the file >> build settings and change the option internal to gradle
Open libs folders separately of both Facebook SDK and Google Play services and delete the matching files
It would be something like (support v4)
Google ads 11.2 has errors. It reuses certain jar classes .
On its own, it isnot an issue
Once you add in another google class, ie firebase, your done for.
There is a fix though. Google put out firebase 4.2 and ads 11.4

Resources