Did anyone successfully build location service into Android Things? I am trying to use LocationServices, but it cannot connect with Google Play.
It complains "W/GooglePlayServicesUtil: Google Play Store is missing." and ConnectionResult is {statusCode=SERVICE_INVALID, resolution=null, message=null}
I have setup wifi on Android Things (Intel Edison) and it can fetch a webpage successfully.
The following is my gradle file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.androidthings.myproject"
minSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:10.2.6'
provided 'com.google.android.things:androidthings:0.4-devpreview'
}
My first ever question on stackoverflow. Many thinks for your help!
compile 'com.google.android.gms:play-services:10.2.6'
Android Things Developer Preview 4 does not support 10.2.6. It supports 10.0.0, as is noted in the release notes. My guess is that your Java code (which is not shown in your question) is going through a code path that is trying to upgrade Play Services to match your 10.2.6, and that is where you are getting your error.
Android Things does not include the Google Play Store, which is responsible for automatically updating Play Services on the device. Because the Play Services version on the device is static, apps cannot target a client SDK greater than the version bundled with the target release. Source :- https://developer.android.com/things/sdk/index.html
Related
App is installing while connecting via USB to mobile, but while sending .apk file to others it saying "App not Installed"(both debug and release).I have tried different solutions from stackoverflow but none worked for me.
1.How to overcome app not installed error when building from Android Studio 3.0?
2.Cannot install signed apk to device manually, got error "App not installed"
3.Android Studio 3.0 Unsigned Apk Not Installing
Below is my build.gradle(app level)
android {
compileSdkVersion 'android-P'
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "XXXXXXX"
minSdkVersion 15
targetSdkVersion 26
versionCode 51
versionName "1.51"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions{
disable 'MissingTranslation'
}
}
Please help me on this.Thanks in Advance.
You can override testOnly flag adding following line to gradle.properties:
android.injected.testOnly=false
Android P preview SDK is a preview and you should not be distributing APKs built with it. Use a non-preview SDK for compiling APKs that are meant for other people to use.
Technically, the installation limitation is that the APKs have testOnly flag set to true. To work around that, see ADB Install Fails With INSTALL_FAILED_TEST_ONLY
I am publishing my app using android studio 2.2 preview 3 and generating signed apk. But when i am uploading apk to google play i am getting error
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.
Also i tried to used zipalign tool manually but i am getting error verification failed.
Here is my build.gradle file
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "blackdogs.newaomsi"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
Got it. Error was due to gradle version i was using.
Downgraded gradle version to
'com.android.tools.build:gradle:2.1.2'
This is a known issue with Android Studio 2.2 Preview 3, as explained in this blog post and this issue.
You have to download Preview 2 or use the stable version of Android Studio.
solved in the next release
classpath 'com.android.tools.build:gradle:2.2.0-alpha4'
reference link:https://code.google.com/p/android/issues/detail?id=212591
I found out that every watch face i made did have a release apk file that never goes under 6Mo.
Even when it does not contain any drawable.
Even the default watch face project is about 6Mo once published & signed.
I assume it is an issue of Android Studio, because some watch face on the store are far lower than 6Mo (ex: Circles Watch Face is about 1.9Mo!!)
I found out that in the intermediate manifest of the mobile package, the following lines are added by the merger:
<activity
android:name="android.support.v7.widget.TestActivity"
android:label="RecyclerViewTestActivity" />
Even with a "tools:node="remove"", it is still added. And with this activity are added a full bunch of ressources (png, values) that I did not use.
Build.gradle of mobile package:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "fr.test"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services:7.0.0'
compile "com.google.android.support:wearable:1.1.+"
}
Did someone experienced the same issue and is there a solution to avoid this or reduce the apk size (an option I missed...)?
There 2 ways to go:
Reduce size using only needed parts of GP services:
Google+ com.google.android.gms:play-services-plus:7.5.0
Google Account Login
com.google.android.gms:play-services-identity:7.5.0
Google Actions, Base Client
Library com.google.android.gms:play-services-base:7.5.0
Google App Indexing
com.google.android.gms:play-services-appindexing:7.5.0
Google App Invites
com.google.android.gms:play-services-appinvite:7.5.0
Google Analytics
com.google.android.gms:play-services-analytics:7.5.0
Google Cast com.google.android.gms:play-services-cast:7.5.0
Google Cloud Messaging com.google.android.gms:play-services-gcm:7.5.0
Google Drive com.google.android.gms:play-services-drive:7.5.0
Google Fit com.google.android.gms:play-services-fitness:7.5.0
Google Location, Activity Recognition, and Places
com.google.android.gms:play-services-location:7.5.0
Google Maps com.google.android.gms:play-services-maps:7.5.0
Google Mobile Ads com.google.android.gms:play-services-ads:7.5.0
Google Nearby com.google.android.gms:play-services-nearby:7.5.0
Google Panorama Viewer
com.google.android.gms:play-services-panorama:7.5.0
Google Play Game
services com.google.android.gms:play-services-games:7.5.0
SafetyNet com.google.android.gms:play-services-safetynet:7.5.0
Google Wallet com.google.android.gms:play-services-wallet:7.5.0
Android Wear com.google.android.gms:play-services-wearable:7.5.0
Use proguard - it will cut all unused code
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
It includes google play services for wareable library, which is large itself. You can reduce the size by using ProGuard.
I followed the instructions at this link to create a simple mobile/wearable app in Android Studio. However, upon trying to run it I am getting the error "Failure [INSTALL_FAILED_OLDER_SDK]". My problem seems to be like the one asked at this link, however unlike that user the reddit post that is linked to didn't contain any information that helped me (it basically suggested to add < uses-sdk tools:node="replace" /> to the android manifest, but android studio didn't like the tools thing." My build.gradle files are exactly the same as those at the above link. I just updated Android Studio today (0.8.2) and have installed all necessary SDK's. Many people are getting this error but mine is unique in that I'm targeting the Wear stuff and not concerned with Android L. Any input is appreciated. Thanks!
I believe I have the answer here. Basically instead of deploying to the phone like the instructions say to, you have to enable bluetooth debugging and deploy directly to the watch.
Do those changes in build.gradle file in the wear module
compileSdkVersion 20
targetSdkVersion 20
So the final wear/build.gradle content will be:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "your package name"
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'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
I am new to Android Studio, but I currently get this error:
error: package com.google.android.gms.maps does not exist
Now, if I in
project/module/build.gradle I do this
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
} }
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile files('src/main/libs/google-play-services.jar') }
I currently get this error:
Could not find method
android.webkit.WebView.setWebContentsDebuggingEnabled
And earlier I got this
Could not find class 'com.google.android.gms.maps.SupportMapFragment'
Whatt is the correct thing to do here / how do I solve above errors?
For reference: I orignally manually converted this project form a broken Eclipse project - sadly, for both Eclipse builds and Android Studio builds, it is the map/library thing that I seem unable o solve. The app is otherwise still working as it was before.
Replace
compile files('src/main/libs/google-play-services.jar')
with
compile 'com.google.android.gms:play-services:4.0.30'
or use newer version if you want.
You need to have Google Play Services downloaded in SDK.