How to resolve the bundle info:error code:4 while running HMS Map Application? - huawei-mobile-services

When I am running HMS Map application getting the following error
Failed to get huawei_module_maps bundle info, error code:4
How to solve the issue?

Can you please confirm if the map bundles are added before loading the map in the code. Please check below code snippet regarding the same.
Bundle mapViewBundle = null;
if (savedInstanceState != null) {
mapViewBundle = savedInstanceState.getBundle("MapViewBundleKey");
}
Make sure MapViewBundlekey is been added.

Related

UEFI edk2/FmpDevicePkg in tianocore crashed after excution

I built FmpDevicePkg in tianocore/edk2. Then, I load eif driver in EmulatorX64 and Minnow Board. It both crashed without any message.
I can set break point with Visual Studio for other driver/app packages. However, as for FmpDevicePkg, it can't set break point and crashed directly after I load the driver.
Does anyone know how to debug it? Or how can I test FmpDevicePkg driver? (or associated capsule)
Any suggestion is highly appreciated.
Thanks!
I
I traced the code and found out it hang at follows:
PcdGetBool (PcdTestKeyUsed);
PcdSetBoolS (PcdTestKeyUsed, TRUE);
Detail as follows:
\edk2\FmpDevicePkg\FmpDxe\ DetectTestKey.c
DetectTestKey (
VOID
)
{
….
// If PcdTestKeyUsed is already TRUE, then skip test key detection
//
TestKeyUsed = PcdGetBool (PcdTestKeyUsed); -> system hang
..
// If test key detected or an error occurred checking for the test key, then
// set PcdTestKeyUsed to TRUE.
//
if (TestKeyUsed) {
DEBUG ((DEBUG_INFO, "FmpDxe(%s): Test key detected in PcdFmpDevicePkcs7CertBufferXdr.\n", mImageIdName));
PcdSetBoolS (PcdTestKeyUsed, TRUE); -> system hang
I modified \MdeModulePkg\MdeModulePkg.dec from
PcdsDynamic, PcdsDynamicEx]
gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003
as below:
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003
It worked fine.

Problem with Firebase Storage reference in Swift program

I am an iOS App developer using Swift. I opened Firebase Storage today and proceeded step by step in accordance with the help document. I can already view the txt file I uploaded on web browser with the url: "https://storage.googleapis.com/my_bucket_name/story_001.txt". But I encountered difficulty in accessing the txt file in the App. I think the problem lies in the generation of the reference. Here is my code:
let ref = Storage.storage().reference();
let txt_ref = ref.child("gs://my_bucket_name").child("story_001.txt");
print(txt_ref.fullPath);
txt_ref.getMetadata{ metadata, error in
if let err = error { print("Failed to get metadata."); }
else{ print("Metadata: \(metadata)"); }
}
I get the following output from console:
gs:/my_bucket_name/story_001.txt
Failed to get metadata.
The two slashes after "gs:" become one slash. I think the problem should come from here.
How can I solve it? Thanks in advance.
You may able to use the reference withPath: API like
let ref = Storage.storage().reference(withPath:"my_bucket_name")
let txt_ref = ref.child("story_001.txt")
See additional examples in these integration tests.

Unity WebGL - Locating code that triggers Reflection.emit

I've run into the dreaded Reflection.emit issue in my webplayer build and am unable to locate what is triggering it. I'm currently commenting out code method by method and rebuilding to locate the cause and have narrowed it down to the below.
I'm not using JSON so the various JSON libraries aren't the cause, nor any of the other result suggestions returned by google.
How can i more easily go about locating the cause of this error. I have full stack trace on and well as full debugging, but all i get is the following console output.
NotSupportedException: C:\Program Files\Unity 2018.2.0b2\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
Rethrow as TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception.
//NOTE: appM.procM is a C# .Net 4.x dynamic variable EG:
//public dynamic procM = GetProcClass(strProcName)
public void ShowProcList() {
/* Rest of method commented out*/
if(appM.procM == null){
procList.Initialize(appM.procM.lstNames, this);
}
/* Rest of method commented out*/
}
public void Initialize(List<string> lstNames, UIM um, string currProc=null) {
uiM = um;
//cleanup of the list before populating
foreach(Transform fld in Panel.transform) {
Destroy(fld.gameObject);
}
/* Rest of method commented out*/
}
Update: I narrowed down the problem line of code, but haven't closed the question as there's got to be an easier way than commenting out line by line and rebuilding.
For future searchers, the issue is the if(appM.procM == null) check. As procM is a dynamic variable reflection is used which kills AOT in webGL builds. No compiler warnings were generated to save myself from myself.
Nevermind, i am an idiot, The option Enable Exceptions under Player Settings was set to Full Without Stacktrace and not Full with Stacktrace.
The value Full With Stacktrace contains the pertinent data. Easily locatable in the browsers console. Warning that full debugging does increase build times and slow down the application.

Integrating ZXing for Glass Release into Android Studio project

I'm working on QR Code scanning on Google glass. I've used ZXing in android and was happy to find a google glass port has been released recently.
I've downloaded and installed the APK on glass and it works great. However I am having trouble incorporating the project into my own project. There is no maven resource and I've tried importing it as a module without success.
I've also tried incorporating the code into my project, however I get a range of compilation errors such as:
Error:(109, 43) type parameter com.google.zxing.DecodeHintType is not within its bound
Error:(163, 44) cannot find symbol method decode(com.google.zxing.BinaryBitmap,java.util.Map).
Here is a link to the provided release - https://github.com/zxing/zxing/releases/tag/BSGlass-0.2.1 - does anyone have any suggestions on how to make an app like the sample one using the provided code?
Thanks in advance.
Use this "Intent" in your activity to start the QR scanner (ZXing) on your Google Glass:
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
You have to then handle the results returned by the scan.
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
String contents = intent.getStringExtra("SCAN_RESULT");
String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
Card card = new Card(this);
card.setText(contents);
View cardView = card.getView();
setContentView(cardView);
} else if (resultCode == RESULT_CANCELED) {
// Handle cancel
}
}
}
You also need to make changes to your AndroidManifest.xml
This blog does a good job at explaining what you need to do -> http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/does

Camera::connect() brings AppOps Bad Call: on Android 4.4?

I wrote an apk to test camera on Android 4.2.2 before. This apk works fine.
However, when I moved this apk to Android 4.4.
I got a problem with Camera::connect().
Fail to call Camera::connect() and it prints message:
W/AppOps ( 1546): Bad call: specified package TestCamera under uid 1000 but it is really -1
I think the reason may be USE_CALLING_UID, security or something that I can't figure out.
Please give me some suggestions, thanks!
My apk is very simple, only one activity. In onCreate(), I called a jni function.
The jni function just do the code belowed:
int cameraId = 0;
String16 clientPackageName("TestToGoService");
sp<Camera> camera = Camera::connect(cameraId, clientPackageName, Camera::USE_CALLING_UID);
if (camera == NULL) {
ALOGE("camera==NULL.");
return -1;
}
ALOGV("camera=%p.",camera.get());
Try:
If I put the code above to a executable (main()), then Camera::connect() works OK.
I have already add permissons on AndroidManifest.xml
Thanks again!
I'm not sure if it's still of any help. I had the same error in the past. The problem is clientPackageName, that has to be set to the exact package name of your application (which must have the proper camera permissions set on the manifest).