Can't install app from Play Store since NativeScript 5.1 - android

I am having an issue when I publish my apps on Google Play store since I updated to NS 5.1/Angular 7. I am not an expert with the AndroidManifest.xml file but I will show you what I have added maybe you can figure out what is going on.
This is my old AndroidManifest.xml used in NS 4.X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="2070" android:versionName="2.0.7">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#style/AppTheme" android:hardwareAccelerated="true">
<activity android:name="com.tns.NativeScriptActivity" android:label="#string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="#style/LaunchScreenTheme" android:screenOrientation="portrait">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity" />
</application>
</manifest>
This is the new one I am using with NS 5.1/Angular 7:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="__PACKAGE__" android:versionCode="2101" android:versionName="2.1.1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#style/AppTheme" android:hardwareAccelerated="true">
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.*.*.fileprovider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths" tools:replace="android:resource" />
</provider>
<activity android:name="com.tns.NativeScriptActivity" android:label="#string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="#style/LaunchScreenTheme" android:screenOrientation="portrait">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity" />
</application>
</manifest>
Also, I have added these lines to app.gradle file:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
}
Since I am using this configuration, the app does not install on my Samsung Galaxy A Tablet.
Also, in some apps it shows a message saying: This app may not be optimized for your device. Not this case.
Any suggestion? Thanks!

I think is because your android support version. The latest version of Nativescript uses 28 so try to remove that change from your gradle

Related

Including AndroidManifest.xml in a Unity3D build causes mobile application to instantly crash

I have an issue where the inclusion of an AndroidManifest.xml file in a android build of a Unity3D project causes the application to instantly crash upon opening. However not including the file causes the application to not be able to access the internet. I'm not very familiar with the structure of manifest xml files so any help would be greatly appreciated.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.DefaultCompany.DynamoDB"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.amazonaws.unity.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.amazonaws.unity.permission.C2D_MESSAGE" />
<application
android:theme="#android:style/Theme.NoTitleBar"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:debuggable="true">
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
</application>
</manifest>
try UnityPlayerActivity instead
UnityPlayerNativeActivity
and check this package name package="com.DefaultCompany.DynamoDB" . maybe it should be package="com.amazonaws.unity"

Unity Android Game requests permission to read phone state but NONE of my manifests have that permission in it

The only permission that i see in the manifest files that i have is :
android.permission.INTERNET
yet whenever i run the game on device, it asks for permission to read phone and contacts information, when i open the manifest inside Temp\StagingArea i do see the request to read phone state, here is the full manifest content :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.game.name" android:versionCode="3" android:versionName="2.3" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:theme="#style/UnityThemeSelector" android:isGame="false" android:banner="#drawable/app_banner">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="io.fabric.ApiKey" android:value="70418cbaf12012ef266c9d170326ef4293fef28b" />
<meta-data android:name="io.fabric.unity.crashlytics.version" android:value="1.2.5" />
<meta-data android:name="io.fabric.crashlytics.qualified" android:value="com.crashlytics.android.Crashlytics" />
<meta-data android:name="io.fabric.crashlytics.unqualified" android:value="Crashlytics" />
<meta-data android:name="io.fabric.kits" android:value="crashlytics" />
<meta-data android:name="io.fabric.InitializationType" android:value="Automatic" />
<meta-data android:name="unity.build-id" android:value="f221d2f3-918c-4005-a864-613d5419c9b9" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="android.max_aspect" android:value="2.1" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
is there any solution to know the cause of this, without having to remove all plugins and add them one by one ?
Edit:
Forgot to mention the "plugins" am using in case some of them rings a bell :
Unity IAP
Unity Analytics
Unity Social
Google AdMob Mediation (UnityAds, Vungle and AdMob)
Crashlytics
Games Analytics

Very few supported devices on Google Play

I developed my app using cordova, uploaded it to Google Play but in the APK tab I can see that there are only 159 supported devices. The app is using network, GPS and storage. Any idea why it's not visible to more devices? This is the AndroidManifest file:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10001" android:versionName="1.0.1" package="com.visitacity.visitacityapp" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="#android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="org.pgsqlite.SQLitePlugin" />
<service android:name="de.appplant.cordova.plugin.background.ForegroundService" />
<receiver android:name="jp.wizcorp.phonegap.plugin.localNotification.AlarmReceiver" />
<receiver android:name="jp.wizcorp.phonegap.plugin.localNotification.AlarmRestoreOnBoot">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest>
I think that the problem is located in the supports-screens or into android:configChanges so try to edit those tags

AndroidManifest "app_banner" issue

i just want to add banner to mygame but when i build my game,i face to this bug in unity console.
AndroidManifest.xml:4: error: Error: No resource found that matches the given name (at 'banner' with value '#drawable/app_banner').
You can find my AndroidManifest.xml file,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity.package" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="#android:style/Theme.NoTitleBar" android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false" android:isGame="true" android:banner="#drawable/app_banner">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<!--
The unityplayer.ForwardNativeEventsToDalvik flag is the only difference
from Unity's auto-generated default AndroidManifest.xml. We require this
flag to be true for ads to be clickable.
If you are using another plugin that also ships with an
Assets/Plugins/AndroidManifest.xml, you can use their copy after setting
this flag to true.
-->
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
#ugur error tells you what is missing as its not in your supplied file list, so you have to put that file in the drawable folder to remove the error..once you add he banner drawable the error will go away
There is a similar question in this link but this didn't work for me:
http://answers.unity3d.com/questions/935508/failed-to-re-package-resources-unity-5.html?sort=oldest
For me changing the AndroidManifest.xml with the following did the trick:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.example.admobtest" android:versionName="1.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<!-- Google Mobile Ads Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name">
<!-- meta-data tag for Google Play services -->
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="unity" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" >
</activity>
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
</manifest>
I had banner.png at correct place and rest of the things were also ok.
It worked when I updated sdk to latest with help of "SDK Manager"

LeadBolt from Unity crash

I registered on leadblot. Download their SDK.
Create folder in my project: Plugins->Android.
Copy AndroidManifest in this folder and sdk which i download.
That's all I did in the example that was in the folder with the SDK.
This file: https://docs.google.com/document/d/1plndrafMw-jBQT6RfUL8H9TfbJcHlh_LgtxPXnLLXIU/pub
My AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.ALTIMGAMES.SUV" android:versionName="1.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name" android:debuggable="false">
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="#string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<receiver android:name="com.hewzyntzcrsflwjnemv.ReEngagement" />
<service android:name="com.hewzyntzcrsflwjnemv.ReEngagementService" />
<service android:name="com.hewzyntzcrsflwjnemv.AdBootReceiverService" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-feature android:name="android.hardware.touchscreen" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
My c# code(where i use adbolt):
using UnityEngine;
using System.Collections;
public class LeadBoltAD : MonoBehaviour {
// Use this for initialization
void Start () {
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
using(AndroidJavaObject ad = new AndroidJavaObject("com.unity.wrapper.LeadBoltUnity", jo)){
ad.Call("loadAd","820080475");
}
}
// Update is called once per frame
void Update () {
}
}
I install my app. When app start he is crash..
Help me please...
You need to set
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
to
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
as explained in Step 6 of the readme file that you posted.
Besides that, I'd need more information to be able to help. From the command-line you can launch adb logcat with your test phone plugged into your computer to stream any error messages back to your console. That can be useful for finding specific errors.

Categories

Resources