Play store console detects android.permission.READ_PHONE_STATE requirement for a Vanilla React Native app - react-native

I created a react native app using react-native init. Did not change a single line of code. (Note: react-native version is 0.55.4)
I generated a singed release APK by following steps given in the official docs.
I tried to upload this APK to Google Play console.
I got the following error:
Your APK or Android App Bundle is using permissions that require a privacy policy: (android.permission.READ_PHONE_STATE)
This is an unexpected behaviour right? Why will a vanilla app require this permission? How can I solve this issue?
Edit 1
My Android manifest is the default one created by react-native init.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.praveenavtestproject">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Edit 2
My app doesn't need any permission to work. It just displays 3 lines of text from a historical literature. It is just for information purpose. In Play Store Console, under Store listing tab, at the bottom, there is a Privacy Policy section. It says If you wish to provide a privacy policy URL for this application, please enter it below. Also, please check out our User Data policy to avoid common violations.
I am not providing a privacy policy URL. My app is not supposed to be accessing any user data or phone state. Does React Native access it by default? Can that be the reason for this issue?
Edit 3
Looks like this issue is already being looked at by React Native team.

Related

The embedded manifest is invalid or could not be read

while running Android debug build in real device app crashing in device with error is
The embedded manifest is invalid or could not be read. Make sure you have configured expo-updates correctly in android/app/build.gradle. app.manifest
Actually, I developed an app with Expo bare flow with expo updates but I did proper expo update installation in my project. The error related to expo updates any suggestions to fix this issue
Just leave these expo update tags in the manifest. That's what solved it for me
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="46.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/#projet/projet"/>
<meta-data android:name="expo.modules.updates.EXPO_RELEASE_CHANNEL" android:value="default"/>
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
Previously it was like this
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="46.0.0"/>
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/#projeto/projet"/>
<meta-data android:name="expo.modules.updates.EXPO_RELEASE_CHANNEL" android:value="default"/>

productFlavors application Id

I'm trying to make two types of builds in Android Studio usung productFlavors.
I need to have unique applicationId for each buld type.
And here is an issue:
First of all I add this code to my gradle file
productFlavors {
base {
applicationId "ru.Public.lib"
}
city {
applicationId "ru.Public.lib.city"
}
Then when I'm trying to build app with city type, Android Studio shows an error:
"Error:Execution failed for task ':app:processBaseDebugGoogleServices'.
No matching client found for package name 'ru.Public.lib.debug'"
After this I decided that I need to change package name at my Manifest file.
I tryed to change package name in Manifest by three ways:
In project structure I created new Manifest app > src > city > AndroidManifest.xml. At this file I use package="ru.Public.lib.city"
I didn't create a new Manifest. Instead of it I used a placehilder for package name like this: package="${applicationId}"
I combined these two methods: "using placeholder at new Manifest in app > src > city >"
All shown ways gives me an error in the Manifest: Android Studio colored activity names by red and says unsolved class 'Activity Name'
Here is a part of my Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.Public.lib">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="ru.Public.lib.app.Application"
android:hardwareAccelerated="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:resizeableActivity="false"
android:supportsRtl="true"
android:theme="#style/AppTheme.NoActionBarDefault">
<activity
android:name=".activities.ActivityMain"
android:configChanges="orientation|keyboardHidden">
</activity>
<activity
android:name=".activities.ActivityEdition"
android:configChanges="orientation|screenSize|keyboardHidden">
</activity>
.....................................................................etc.
</manifest>
So. It looks like I need to recreate all my acivities in new directories acording to every packege name I need. But it is too complicated way. I'm sure that Google solved this problem.
Do anybody have some ideas about this issue?
Thanks!
Here are some step to solve it.
Go to your firebase console
Select your previous project and Add another app
Register another applicationId (Register all of your applicationID one by one)
Then Download new google-services.json
And place new google-services.json in your project
Thats it

GCM notifications suddenly stopped working , Not recieving notifications at all

I have created an app with GCM notifications and moved it to live it was working well for quite some time, 2, 3 months then suddenly stopped receiving notifications. Gone the code but not able to understand what went wrong and where should I fix.
Here is my manifest.xml
<activity android:name="com.ind.MainActivity"/>
<activity android:name="com.ind.ChaptersActivity"/>
<activity android:name="com.ind.SectionsListActivity"/>
<activity android:name="com.ind.SectionDetailActivity"/>
<activity android:name="com.ind.RuleDetailsActivity"/>
<activity android:name="com.ind.PartsListActivity"/>
<activity android:name="com.ind.PartsDetailActivity"/>
<activity android:label="#string/title_activity_web_dev" android:name="com.ind.Circulars"/>
<activity android:name="com.ind.CircularsDetailsActivity"/>
<activity android:label="#string/title_activity_web_design" android:name="com.ind.Notifications"/>
<activity android:label="#string/title_activity_web_maintain" android:name="com.ind.PressNotes"/>
<activity android:name="com.ind.UpdateDetailsActivity"/>
<activity android:name="com.ind.NotificationDetailsActivity"/>
<activity android:name="com.ind.UpdatesActivity"/>
<activity android:name="com.ind.Comparision"/>
<activity android:name="com.ind.ComparisionActivity"/>
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="com.ind"/>
</intent-filter>
</receiver>
<service android:name=".GCMIntentService"/>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
</application>
Please let me know is there is something wrong.
From Database I could see that devices are registering properly, and all see the same thing from logs even.
You should be sure that you correctly proccesses these things:
NotRegistered is error code from GCM server. Getting this code you should immediately remove regId from your database
cannonical_ids is a signal that you should replace regId with new one
You must request new regId from GCM while updating your client app
Also if you have all regIds in your database, you can try to send test push to them and check what is respone from GCM. You can use my dev push server for these purposes.

NoClassDefFoundError Google-Play-Services / Maps

Getting NoClassDefFoundError within project and in Google Maps for Android sample found in google-play-services folder.
I have tried so far:
Importing google-play-services_lib into workspace through wizard and making sure code is copied to directory
Manually copying google-play-services_lib into directory with sample, then importing into workspace
Copying jar into workspace
Google Play Services is installed on test devices (Nexus 5, Galaxy S4)
There is a green check next to the library under my project when going to properties > android
I can see the classes in source at compile time, compiles with no errors
Reinstalled the lib from the Android SDK Manager and made sure the key is correct in Google API console; also made sure v2 of maps was enabled for that key
Added proguard exceptions as per integration instructions
Any ideas?
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.projectname"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="21" />
<permission
android:name="com.package.projectname.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.package.projectname.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.package.projectname.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.package.projectname.MapActivity"
android:label="#string/title_activity_map"
android:parentActivityName="com.package.projectname.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.package.projectname.MainActivity" />
</activity>
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value=“my_key_from_google_api_console” />
</application>
</manifest>
I don't think you need the line:
<uses-library
android:name="com.google.android.maps"
android:required="true" />
In fact, I think that's the name of the old maps library. Try removing it and see if that fixes your problem. Also, make sure your code is importing from com.google.android.gms.maps and com.google.android.gms.maps.model, the packages for Google Maps API V2.
UPDATE
Your build configuration isn't including the Google Play Services jar in your APK.
To fix this in IntelliJ: https://stackoverflow.com/a/17977734/1235702
To fix this in Eclipse, follow steps 3 and 4 here: https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw (I didn't write this doc, but kudos to whoever did!)
Add the Google Play Services project into your Eclipse workspace.
Click File -> Import..., select Android -> Existing Android Code into Workspace
Browse to and select /extras/google/google_play_services/libproject/google-play-services_lib
To add the dependency to Google Play Services into your project
Project -> Properties -> Android -> Library, Add -> google-play-services_lib
(Sorry; the markdown won't let me set the numbers to 3 and 4 explicitly.)
Screenshot from OP for posterity:

GPS provider not available

I have followed http://www.vogella.de/articles/AndroidLocationAPI/article.html
to implement the GPS Apps ( Google Maps)
I have installed Google API 8 , installed the Console and type geo fix, register the google MAP API Key.
But I don't why my application has been stopped unexpectedly
Here is my manifest.xml
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".ShowMap" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
</application>
You have add a library to the manifest file.
<uses-library android:required="true"
android:name="com.google.android.maps"></uses-library>
Add this line as application child in your manifest file. Then you might not get the error.
Hope this works.