I've a Moto 360 and I can't install the wearable app (which is distributed as a beta testing app alongside with a mobile app in the Play Store) in it.
While developing both apps I had no trouble installing it, debugging over bluetooth etc... But when I install the mobile app in my phone through the Play Store the watch doesn't install the wearable app.
Wearable gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
dataBinding{
enabled = true
}
defaultConfig {
applicationId "my.app"
minSdkVersion 21
targetSdkVersion 24
versionCode 56
versionName "1.0.0"
}
...
productFlavors {
dev {
applicationId "my.app.dev"
}
}
dependencies {
compile project(':shared')
compile 'com.google.android.support:wearable:2.0.0-alpha2'
compile 'com.google.android.gms:play-services-wearable:9.6.1'
}
}
Wearable manifest:
...
<uses-feature android:name="android.hardware.type.watch"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
...
Mobile gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "my.app"
minSdkVersion 15
targetSdkVersion 24
versionCode 56
versionName "1.0.0"
}
...
productFlavors {
dev {
applicationId "my.app.dev"
}
}
}
...
dependencies {
compile project(':shared')
...
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:9.6.1'
}
Mobile manifest:
...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<!--GCM-->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
...
What could it be?
EDIT: Today I've found through the Google Play Console that my wearable app was rejected, but the error message isn't quite specific. I'm following this functionality criteria and this is the email I've received:
Eligibility issues:
-Your app does not have Android Wear functionality that’s visible to the user.
If you’re adding wearable features to notifications, make sure they're
triggering when appropriate.
You can review this checklist to make sure your wearable app is
packaged correctly:
Include all the permissions declared in the manifest file of the wearable app in the manifest file of the mobile app. For example, if
you specify the VIBRATE permission for the wearable app, you must also
add that permission to the mobile app.
Ensure that both the wearable and mobile APKs have the same package name and version number.
Sign your app.
Test your app on a variety of different Android Wear devices and configurations.
So, what's: WR-VF - App has Wear functionality that is visible to the user.?
Thanks.
Your Gradle files don't show any signing details. You must sign both the mobile and wearable apps with the same certificate.
I ended up finding the solution but forgot to share:
dependencies {
wearApp project(path: ':wear', configuration: 'productionRelease')
...
}
Where 'productionRelease' = productFlavor+buildType
EDIT: gradle-plugin-3-0-0-migration
Related
I have android app available on google play store, I made a new wear application (in new project) that need the companion application(phone app already distributed) to work, i made changes in app code to send data to wear app and check the connection and i test both mobile and watch and everything working fine.
The wear app has same applicationId of mobile app, the app has one flover but the wear app dose not have any flover.
App Manafist
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:networkSecurityConfig="#xml/network_security_config"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
Wear Manafist
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature
android:name="android.hardware.type.watch"
android:required="true" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:name=".WearApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.DeviceDefault">
<uses-library
android:name="com.google.android.wearable"
android:required="true" />
<!--
Set to true if your app is Standalone, that is, it does not require the handheld
app to run.
-->
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="false" />
Mobile Gradel
android {
compileSdkVersion 30
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
flavorDimensions "channel"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
}
productFlavors {
new_app {
applicationId "com.company.app"
versionName "3.0.14"
versionCode 332100314
}
}
Wear Gradle
compileSdk 32
defaultConfig {
applicationId "com.company.app"
minSdk 25
targetSdk 32
versionName "3.0.15"
versionCode 332100315
}
I test the connection and sending data and sync between app and wear and everything working fine and as expected.
Before release to production i want thee QA team to test the app using google play consle, so i make new open test build and i upload 2 aab (mobile and wear) and i got approval and when i try to test through google play the mobile build working fine and i can see my new changes but for watch google play for watch device it says "Won't work on your device"
I have go through android wear distribution doc and make everything and seems my app knows that I'm supporting watch, but until now i can't install the wear app on the watch.
Is the flavor should be in wear app?
why the application is not showing in the watch and says it's not compatible?
Is the compile SDK or target SDK should be same?
what I should do to install the app on both devices from google play as this image.
I have two flavors: Customer and Driver. Both have different applicationIds(1. com.sample.Driver
2.com.sample.customer).
I can't install customer if Driver is installed and vice-versa.
I just cannot install both on the same device via Google Play. It works fine with apk install.
build.gradle:
productFlavors {
Customer {
applicationId "com.sample.customer"
minSdkVersion 16
targetSdkVersion 26
versionCode 21
versionName "3.6" }
Driver {
applicationId "com.sample.Driver"
minSdkVersion 15
targetSdkVersion 26
versionCode 20
versionName "3.6" } }
Main manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sample">
Driver manifest:
<manifest xmlns:tools="http://schemas.android.com/tool"
xmlns:android="http://schemas.android.com/apk/res/android">
I did small mistake for package name static(com.pcc.flavors) so getting
signature issues, after changed applicationId dynamically, it's working fine.
<permission
android:name="com.pcc.flavors.permission.MAPS_RECEIVE"
android:exported="false"
android:protectionLevel="signature"/>
to
<permission android:name="${applicationId}.permission.MAPS_RECEIVE" android:exported="false"
android:protectionLevel="signature"
tools:ignore="WrongManifestParent"/>
I recently upgraded to android studio 3.1 and when i build out my project as a signed release the google play console tells me that there are 3 new permissions which i did not add to my manifest.
I then checked the manifest merger report and saw the following explaination:
uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
IMPLIED from /Users/me/Development/QA/android/myapp/app/src/main/AndroidManifest.xml:2:1-222:12 reason: com.google.android.gms.license has a targetSdkVersion < 4
uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from /Users/me/Development/QA/android/myapp/app/src/main/AndroidManifest.xml:2:1-222:12 reason: com.google.android.gms.license has a targetSdkVersion < 4
uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from /Users/me/Development/QA/android/myapp/app/src/main/AndroidManifest.xml:2:1-222:12 reason: com.google.android.gms.license requested WRITE_EXTERNAL_STORAGE
What does this mean , why is it saying the license class has a targetSdkVersion less then 4 ?
here are my gradle dependency versions:
firebase_version = '12.0.1'
supportlib_version = '27.0.2'
room_version = '1.0.0'
espresso_version = '3.0.1'
archLifecycleVersion = '1.1.1'
and here are my minimum sdks:
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
applicationId "com.mobile.myapp"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
i did check the release notes for google api and saw that firebase was updated to 12.0.1 but im already using that. My goal is i do not want these permissions if they are not needed by google. i dont want to include these permission if its just for a license file ? any ideas ? i also do not know what an implied permission is. but let me show you my actual permissions in my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mobile.myapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<!-- firebase analytics needs to hold a wake lock -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- hotline io uses record audio dangerous permission, we will remove it here -->
<uses-permission
android:name="android.permission.RECORD_AUDIO"
tools:node="remove" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
//...
UPDATE:
here is my google play services version:
<integer name="google_play_services_version">12211000</integer>
and i have two google play services components i use here they are:
// Analytics
implementation "com.google.android.gms:play-services-analytics:$firebase_version"
implementation("com.google.android.gms:play-services-auth:$firebase_version") {
force = true
}
WHERE firebase_version = '12.0.1' IS THE LATEST.
and here are the top level dependencies:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.0'
classpath 'io.fabric.tools:gradle:1.25.1'
classpath "com.newrelic.agent.android:agent-gradle-plugin:5.+"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
The following steps rectified the issue:
update gradle wrapper to latest 4.6
then create the following dependency resolution strategy that forces all libraries to comply with latest version (at this time) of google play libraries:
subprojects {
//todo change this to loop once
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex')) {
details.useVersion "$supportlib_version"
}
else if(details.requested.group == 'com.google.android.gms'){
details.useVersion(firebase_version) //this is critical to resolve the error
}
}
resolutionStrategy {
forcedModules = [
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version",
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
]
}
}
}
Upgrade your Google Play Services to 12.0.1
In its release notes (https://developers.google.com/android/guides/releases) you can find the following:
Adds missing minSdkVersion in -license artifacts to prevent automatic
inclusion of READ_PHONE_STATE and READ_EXTERNAL_STORAGE permissions.
I can't use Google Play services with the emulators in Android Studio. I give you my build.gradle and manifest files:
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "fr.myapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:multidex:1.0.1'
}
Part of my AndroidManifest (I don't show all the activities):
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings" >
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
</application>
</manifest>
And in a xml I just have the google button : com.google.android.gms.common.SignInButton
And when I lauch my Application, when I arrive in the activity containing the button, I have the following message : "the app won't run unless you update Google Play services". I also have (I tried some solutions) "this app won't run without Google Play services, which are missing from your phone".
I've found some questions on this problem, but it always said that the last emulator don't have this problem. But using the default Nexus 5 (API 22) emulator on android studio gives me these errors. So I tried to install the last apk google play services file, and after successing the install, I launch the app and have this time this error : "the app relies on Google play services, which is not supported by your device. Contact the manufacturer for assistance." I also tried with a virtual device that I created, with API 22 and 23 and I have the same errors.
I don't understand because I thought that the errors with Google play services didn't exist anymore on the last API.
Thanks for help.
Maybe try to create emulator with image x86 which includes Google APIs
I have a simple Android Wear app that runs fine on the Gear Live and in the Emulator, and which I'd now like to package into an .apk for distribution.
I'm using Android Studio but am more familiar with Eclipse for Android development, so may have something wrong.
Here is the build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "myApp"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v13:+'
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
wearApp project(':app')
}
and here is the Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="myApp" >
<uses-feature android:name="android.hardware.type.watch" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault" >
<activity
android:name="myApp"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--
<category android:name="android.intent.category.LAUNCHER" />
-->
</intent-filter>
</activity>
</application>
</manifest>
The gradle build completes without error: I sign the app with the same keys I use for non-wear apps in the Play Store. Whether I open the created apk file on a device running Android 4.4.4, or a device running 4.3 (the 'phone that's actually in communication with the Gear Live), I obtain the error:
"There is a problem parsing the package"
Initially I assumed that this was because the 'phone was running 4.3, whereas the target/min SDK is 20. But I get the same parse error on a 4.4.4 tablet.
Could anyone suggest what I may have wrong?
On the mobile (phone) app your Min SDK should be 18 with target sdk at 20 since your phone is running 18 (4.3) and your tablet is running 19 (4.4).
On your wear app it should be Min SDK 20.
Also just a gotcha I found is you need to sign both the mobile and wear app's which you may hit next.