"nativescript-google-maps-sdk" PlugIn shows blank screen - android

I have installed nativescript-google-maps-sdk plugin in my NativeScript 2.0 project.
I generated and activated an Android API key at the Google Developer Console.
As described in the documentation of the plugin I added the string resource value nativescript_google_maps_api_key with the API key, but it does not work.
I also tried to add the google_maps_key string resource as described in the official Google documentation, so my resource file looks like this:
<resources>
<string name="google_maps_key">MY_API_KEY</string>
<string name="nativescript_google_maps_api_key">MY_API_KEY</string>
</resources>
My last try was to add a meta value to the AndroidManifest.xml file:
<manifest>
<application>
...
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="MY_API_KEY" />
</application>
</manifest>
In my app.gradle file I added a reference to the com.google.android.gms:play-services-maps:8.3.0 package.
But nothings helps ... I still have a blank screen with a Google logo but no map.

I had same problem.
After I checked "Use Host GPU", it worked
Open Android Virtual Device (AVD) Manager
Select emulator and click Edit
Check Emulator Options: Use Host GPU

I was unable to run this plugin correctly, maybe it is not compatible with NativeScript 2.0.
However you could use official NativeScript plugin nativescript-geolocation or nativescript-googleMaps, which work normal on both iOS and Android.
You could read more about the plugin here: NativeScript Location
Also you could review this sample app with nativescript-googleMaps location
To upgrade the project to latest NS 2.0. run npm install tns-core-modules#latest --save
Indeed you should add this line
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="API_KEY" />
before </application> closing tag in AndroidManifest.xml

I have followed the exact steps as shown in the demo app and it worked correctly!
Now the first thing I have noticed is that the file with your API-Key is located as follows
App_Resources/Android/values/nativescript-google-maps-api.xml
And looks like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nativescript_google_maps_api_key">your-api-key-here</string>
</resources>
In the map-page.xml we have
<Page xmlns="http://www.nativescript.org/tns.xsd" xmlns:maps="nativescript-google-maps-sdk" loaded="pageLoaded">
<GridLayout>
<maps:mapView latitude="{{ latitude }}" longitude="{{ longitude }}" zoom="{{ zoom }}"/>
</GridLayout>
Keep in mind that in the demo the author has passed the params via view-model but
you can always hardcore the values for latitude ,longitude and zoom for test pourposes.
And thats all that is needed in order for the plugin to work.

If you're having this problem, and everything you try does not seem to do anything, I would recommend checking your Android Logs.
adb logcat
Check for the following:
Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
This was my problem. The emulator I was using did not support the stated version of OpenGL. So I created a new emulator, checking off Use Host GPU and that seemed to cure the blank map with logo issue.
I think the Use Host GPU is the key. The old emulator I was using didn't have this option, so I couldn't verify this.

Related

Ionic - Android authorities: FacebookContentProvider undefined in android manifest

Can’t install because provider name com.facebook.app.FacebookContentProviderundefined (in package io.ionic.sxxxx) is already used by io.ionic.yyyyy]"
This is listed in a few android manifest files
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider"
android:exported="true" />
on build I get
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProviderundefined"
android:exported="true" />
— notice the undefined ----- should I be defining something somewhere? Is there another solution? Basically I have a pair of apps that will not install at the same time on a device because this output is the same. My understanding is undefined should be my facebook id. I do have a variety of values defined in my android strings file. I have seen a few answers from a couple years ago on here (Android Facebook content provider authority) , but the solutions do not work as the files in my android directory are different as are their contents. Any help would be much appreciated!
<string name="title_activity_main">xxxx</string>
<string name="package_name">io.ionic.xxxx</string>
<string name="custom_url_scheme">io.ionic.xxxx</string>
<string name="fb_app_id">xxxxx</string>
<string name="facebook_app_id">xxxxx</string>
<string name="fb_app_name">xxxxx</string>
<string name="fb_login_protocol_scheme">fbxxxxxx</string>
<string name="fb_auto_log_app_events_enabled">true</string>
<string name="fb_advertiser_id_collection_enabled">true</string>
I have tried deleting all of the tags from all of the android manifest files, but they are generated on build. I have tried adding a string called authority in my string.xml file. I have struggeled to figure out how to implement the solutions here, as they dont exactly align with the files in my ionic project. Android Facebook content provider authority.
There is an open issue about this on GitHub:
https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/100
Did you try the temporary solutions provided in the comments?
HCJSolutions commented on Dec 10, 2021
I found a temporary solution is add ${applicationId}
modified the platforms\android\app\src\main\AndroidManifest.xml find a
node 123456789"
android:exported="true"
android:name="com.facebook.FacebookContentProvider" />
or
change it at
plugin folder plugins\cordova-plugin-facebook-connect\plugin.xml find
the line <provider
android:authorities="com.facebook.app.FacebookContentProvider${applicationId}$APP_ID"
and
apren commented on Apr 24:
Another temporary solution:
Set any APP_ID, for example APP_ID = "app_package_name" After init app
use code
facebookConnectPlugin.setApplicationId('your_facebook_app_id')

Unable to create preview of the app actions used in the app in google assistant

I have added the shortcuts.xml in res/xml and also added the
<meta-data
android:name="android.app.shortcuts"
android:resource="#xml/shortcuts" />
in the AndroidManifest.xml and also uploaded the signed bundle file in the play console internal testing.
But I'm getting the below error while creating the preview using the google assistant app actions test tool in android studio
Google Assistant plugin v2.3.0
Preview Creation Error
Status Code: 400
Message: Precondition check failed.
- Please sign in to Play Console (https://play.google.com/apps/publish) and check if you have accepted the latest Terms of Service (ToS), and the Gmail/G-Suite account has the authorization to modify the app with package name 'uninitialized.application.id'.
The part of the error message that reads
modify the app with package name 'uninitialized.application.id'
seems particularly strange. There are a few things I would make sure about:
Make sure your app/build.gradle has the correct applicationId in the defaultConfig section and that you use this Id elsewhere.
Make sure that was the version that you uploaded.
Ensure that the account that you used for the play store is the same account that you're using to for the test tool.
This issue suggests that a default applicationId may have been assigned and set in the merged manifest, and that you can just rebuild the entire project once you have it correctly set in app/build.gradle

AR/VR Vuforia Failed to Initialize

I have gone through every possible adjustment variable I could find to try to try to make this work:
I adjusted sdk versions: android:minSdkVersion="19" android:targetSdkVersion="22"
I made sure that all my settings matched this: https://library.vuforia.com/articles/Solution/Integrating-Cardboard-to-the-ARVR-Sample
I also followed these instructions for Android:
https://developer.vuforia.com/forum/faq/unity-player-settings
I even changed AndroidManifest.xml to be AndroidManifest-Vuforia.xml
I'm running
Unity 5.3.0 / Vuforia6.0.117 / Samsung Galaxy S6 Active / And the latest google cardboard
The program compiles and runs perfectly on my webcam, but the second I install it on my phone and run it, I keep getting the same Vuforia Initialization Error no matter what I do. And yes, I made sure to give the app permission to use the camera.
Can anyone help? I've scowered the internet and I cant get the thing to work.
Under the 'Vuforia' menu, click 'Configuration', then disable the 'webcam' setting.
I had this problem and it was because I didn't write my Vuforia license key. In the class SampleApplicationSession find the line thats similar to this:
Vuforia.setInitParameters(session.mActivityRef.get(), session.mVuforiaFlags, "KEY_HERE");
It could be on line 370 or 414. But insert your key there and that could fix it.
I had same problem in android studio to fix it I first get licenseKey from here and then go to Project-> app/cpp/Croossplatform/AppController of my projects and then go to the
namespace
{
constexpr char licenseKey[] = "your key ";
}
line 55-60 AppController
This seems to be a problem in the Vuforia Unity package. Download the latest Vuforia-Unity package from https://developer.vuforia.com/downloads/sdk and import the new package into the project and replace the old package. This should resolve the error.
Other possible fixes that didn't seem to help in my case included: giving camera permissions in AndroidMainfest File, changing the Vuforia API key and disabling Vuforia Play Mode.

xamarin google map not working

I created a map using the following link http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/part_2_-_maps_api/ i followed all the procedures mentioned in it but what am getting is a blank screen. My application Output shows the following log on executing the map activity.
Open Connection [REQUEST] DRD(41): 62|147 [REQUEST] Close [REQUEST] Error processing: com.google.maps.api.android.lib6.b.d#42a1cef8 not retrying [REQUEST] Retrying: com.google.maps.api.android.lib6.c.au#429ced70
Can anyone please tell me why this is happening.
If you are unable to view the map after deploying a Release apk, follow this Video..
https://www.youtube.com/watch?v=xLJ0jDFdUZ0
As it says :
Create a KeyStore from Visual Stuido.
a. Put project config mode to Release.
b. Clean and Build your Android project.
c. Right click your Android project and select Archive (Before that specify the version code and version name in your manifest or in properties).
d. Once the archive is completed, click on Distribute.
e. Select AdHoc channel.
f. Create a new Signing Identity with Alias, Password and other info.
g. This signing key creates a KeyStore file in location :
C:\Users\[UserName]\AppData\Local\Xamarin\Mono for Android\Keystore\[Alias]\[Alias].keystore
Note : [Alias] is the name you defined when creating the KeyStore file
Open your cmd. cd to C:\Program Files\Java\jdk1.8.0_131\bin
Execute : keytool -list -v -keystore "C:\Users\[UserName]\AppData\Local\Xamarin\Mono for Android\Keystore\[Alias]\[Alias].keystore" -alias [Alias]
You will get the output with MD5, SHA1, SHA256... Copy the SHA1 key.
Go to https://console.developers.google.com . Select your project you created for Android API key.
Click on credentials and select your API key.
Add new Package name and finger print with your project's package name and SHA1 key you copied.
Note : Project's package name defined on Android Project's manifest and properties.
Wait for like 5 mins to take the changes to affect. Afterwards you can again archive and get a new APK. Install on your android device and see. You will now be able to see the map.
NOTE :: I am referring to Xamarin, Visual Studio 2017
As #Miha mentioned this is keys related.
At present you will not be getting any map tiles displayed on the map.
To get the example to work there are several things that you need to do.
1) Obtain your Signing Key Fingerprint (SHA1) for your machine.
If you haven't already created your SHA1 key for your machine you will need to do this first. The link here describes how to generate this using the command console.
You will get a SHA1 key fingerprint as a result of this.
2) Obtain the package name from the project you are working on.
This can be located by looking at the Android project properties under the Android Manifest tab. You will then see a text-box for the Package name field.
3) In Google Developer Console you will need to create an Application should you not already have one, and Create A New Android key (This is located under APIs & auth \ Credentials).
On the screen that will pop-up you will be able to enter in the SHA1 key and Package Name that you have previously captured in the format {SHA1};{Package Name}.
This will then return to you the API key that you will use in the next step:-
4) In the Android Project, look at the source for AndroidManifest.xml. You will see the following:-
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="{some api key}" />
Enter you API key in that you have previously captured.
5) In the Google Developer Console, for the project, you also have to remember that you have to enable Google Maps Android API v2 and also Google Play Android Developer API. You can find these under APIs & auth \ APIs
You should then, finally, be able to run the demo.
Update 1:-
Add the uses-permission for MAPS_RECEIVE as #leoneboaventura mentioned also, so something like the following:-
<uses-permission android:name="{your-package-name}.permission.MAPS_RECEIVE" />
I just figured out what was wrong in my case. Probably because of Java naming rules, you have to name your package with the first letter in lowercase. Visual Studio names our packages following C# naming rules, which spells the first letters capitalized.
So, check if this issue isn't the same causing your map to don't open by doing the following:
1) Make sure your package name starts with small letter.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mypackage.android" android:versionCode="1" android:versionName="1.0">
Make sure your package is named mypackage.android not MyPackage.android.
2) Make sure your package name in the following two permissions matches the manifest package name spelling:
<uses-permission android:name="mypackage.android.permission.MAPS_RECEIVE" />
<permission android:name="mypackage.android.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
3) Check if you APIKey is been generated to the same package name:
{your SHA1 certificate fingerprint}:mypackage.android
Change AndroidManifest.xml like this
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application ...>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="yourApiKey" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
</application>
<queries>
<package android:name="com.google.android.apps.maps" />
</queries>
</manifest>

new blackberry app world error "bar manifest file package version must be greater than ..."

I've started getting a weird error message when trying to upload a playbook app update to BlackBerry world. I think this problem started after installing version 1.6.1 of their eclipse plugin.
The error message:
"The package version in your .bar manifest file for signals_playbook must be greater than the previous version, but lower than any the next release version added to the vendor portal. . Your .bar manifest file package version must be greater than 3.0. Correct your .bar manifest file and try again to continue."
My AndroidManifest.xml contains:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.rcp.mobile.cror.signals"
android:versionCode="7"
android:versionName="3.1" >
The Manifest file contained within the BAR shows this info:
Archive-Manifest-Version: 1.1
Archive-Created-By: Apk2Bar version 1.6.1
Package-Author: xxxxxxxx
Package-Author-Id: some hash xxxxxxxxx
Package-Name: xxxxx.cror.signals
Package-Id: some hash xxxxxxxxx
Package-Version: 1.0.7.1
Package-Version-Id: some hash xxxxxxxx
Package-Type: application
Package-Architecture: armle-v7
Package-Author-Certificate-Hash: some hash xxxxx
Application-Name: Railway Signals
Application-Id: some hash xxxxxxxx
Application-Version: 1.0.7.1
Application-Version-Id: some hash xxxxxxxxxxx
Application-Requires-System: Tablet OS/2.0.0.7109
My system:
Windows 7 x64 using Eclipse 3.7.2 with latest ADT and updates.
I can see why BlackBerry world is complaining, it thinks the version number is 1.0.7.1. How do I get it to show 3.1.0.0??
I tried editing the manifest file contained within the bar, saving it and resubmitting. But that didn't work (didn't think it would but was worth a try).
Does anyone know where is the 1.0.7.1 coming from?
Can I override it?
Thanks
Rob
We suddenly started having the same problem with our builds. Evidently something changed in the BlackBerry build tools. Try setting the application's android:versionName attribute to a 4-part value (such as 3.1.0.1). BlackBerry has always used this format (major.minor.micro.build) for native apps. It seems that unless your Android manifest has the same format, the BlackBerry build tools fail to parse the versionName attribute and use a fall-back. From what I can tell, the fall-back is to use the value of android:versionCode as the micro version in a default application version code; that is it sets the app version in the .bar file manifest to
1.0.<android:versionCode value>.1
(I sure wouldn't want to be the engineer that had to defend implementing this behavior.)
An alternative approach is to create a custom manifest file that has the app version you want. Create a file named MANIFEST.MF in the same directory as AndroidManifest.xml. Then add the specific .bar manifest entries you want. For instance, it might be:
Archive-Manifest-Version: 1.1
Package-Version: 3.1.0.0
Application-Version: 3.1.0.0
Then open the project properties in Eclipse, navigate to BlackBerry, and for the "Custom BAR Manifest" drop-down, select "Add custom values (merge)".
Thank you, Ted!
There is another link on this topic;
http://supportforums.blackberry.com/t5/BlackBerry-World-Development/The-package-version-in-your-bar-manifest-file-for-New-Bundle/td-p/2754567
We started to notice problem after move to Gradle:
Before
AndroidManifest.xml:
android:versionCode="1312310309" android:versionName="2.28.4"
MANIFEST.MF:
Application-Version: 14.1231.309.0
After
AndroidManifest.xml:
android:versionCode="134" android:versionName="2.30.31402271059"
MANIFEST.MF
Application-Version: 1.0.134.0
I also had the same problem but I fixed it by adding this line in my Android Manifest file android:versionCode="30" previously I had android:versionCode="29" so upgraded it by one .And the problem got fixed for me.

Categories

Resources