I'm trying to get a wearable app installed through an Android handset using the 'Package with Android Studio method' found here but it's not working. The apk is never installed to the wearable device. This is the logcat output:
07-28 15:11:54.107 766-820/? W/PackageManager﹕ Unknown permission com.google.android.wearable.READ_SETTINGS in package com.google.android.gms
07-28 15:11:54.117 766-820/? W/PackageManager﹕ Not granting permission com.google.android.gm.permission.AUTO_SEND to package com.google.android.wearable.app (protectionLevel=2 flags=0x88be44)
07-28 15:11:54.117 766-820/? W/PackageManager﹕ Not granting permission android.permission.MEDIA_CONTENT_CONTROL to package com.google.android.wearable.app (protectionLevel=18 flags=0x88be44)
07-28 15:11:55.047 632-632/? D/WearablePkgInstaller﹕ Got PackageUpdateReceiver message Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:my.package.name flg=0x4000010 cmp=com.google.android.wearable.app/com.google.android.clockwork.companion.packagemanager.PackageUpdateReceiver (has extras) }
07-28 15:11:55.177 632-632/? D/WearablePkgInstaller﹕ Got PackageUpdateReceiver message Intent { act=android.intent.action.PACKAGE_ADDED dat=package:my.package.name flg=0x4000010 cmp=com.google.android.wearable.app/com.google.android.clockwork.companion.packagemanager.PackageUpdateReceiver (has extras) }
As a side note I am able to package manually (also described in the link above) and the apk gets installed on the wearable device when I run it on the handset. I am using buildToolsVersion 20.0.0, I'm running Android Studio 0.8.2 and have this line in my handset module's build.gradle:
wearApp project(':wearable')
I've run out of ideas on how to debug this, the logs seem pretty useless. Any ideas?
EDIT: Going to post relevant sections of Manifest and build.gradle for both the handset and wearable module.
Handset Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name"
android:installLocation="auto"
android:versionCode="259"
android:versionName="4.6.1">
<!-- =========== -->
<!-- PERMISSIONS -->
<!-- =========== -->
<permission
android:name="my.app.name.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- ====================== -->
<!-- APPLICATION PROPERTIES -->
<!-- ====================== -->
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"/>
<application
android:name=".AppState"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.MyApp"
android:hardwareAccelerated="true">
<!-- ==================== -->
<!-- GOOGLE PLAY SERVICES -->
<!-- ==================== -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<!-- ================== -->
<!-- Android Wear -->
<!-- ================== -->
<service
android:name=".wear.DataLayerListenerService" >
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
<!-- This is used for manual packaging I have this commented out when -->
<!-- packaging with Android Studio-->
<!--<meta-data android:name="com.google.android.wearable.beta.app"-->
<!--android:resource="#xml/wearable_app_desc"/>-->
...The rest of the activities
</application>
</manifest>
Handset build.gradle
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
apply plugin: 'newrelic'
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:20.0.+'
compile 'com.android.support:appcompat-v7:20.0.+'
compile project(':facebook')
compile project(':mopub-sdk')
compile project(':GooglePlay')
compile 'com.newrelic.agent.android:android-agent:3.+'
compile 'com.crashlytics.android:crashlytics:1.+'
androidTestCompile fileTree(dir: 'tests/libs', include: '*.jar')
wearApp project(':wearable')
}
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
//Build type is debug to avoid conflict with Proguard
testBuildType = "debug"
defaultConfig {
testApplicationId "my.package.name.test"
testInstrumentationRunner "com.zutubi.android.junitreport.JUnitReportTestRunner"
}
lintOptions {
// We do not want to abort the build due to lint errors
abortOnError false
}
sourceSets {
// Main is the default unless stated otherwise
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Testing
androidTest.setRoot('tests')
androidTest {
java.srcDirs = ['tests/src']
res.srcDirs = ['tests/res']
}
// Cannot add beta icons in here because custom flavour source sets are created
// during compilation and name duplication will result in a crash
}
signingConfigs {
debug {
storeFile file("**")
storePassword "***"
keyAlias "***"
keyPassword "***"
}
release {
storeFile file("***")
storePassword "***"
keyAlias "***"
keyPassword "***"
}
}
buildTypes {
// Development configuration
debug {
debuggable true
jniDebugBuild true
signingConfig signingConfigs.debug
runProguard false
}
// Release configuration
release {
debuggable false
jniDebugBuild false
signingConfig signingConfigs.release
// COMMENTED PROGUARD OUT FOR NOW TO SEE IF IT WILL HELP
// // Configure ProGuard
// runProguard true
// // General configuration
// proguardFile 'proguard/proguard.cfg'
// // Add all of our component-specific configurations (excluding the Android generic, as we want it to be last)
// FileTree tree = fileTree(dir: 'proguard', include: '*.txt', exclude: 'Android.txt')
// tree.each {File file ->
// proguardFile file.getCanonicalPath()
// }
// // Add a fallback configuration for all Android apps
// proguardFile 'proguard/Android.txt'
}
// Release configuration, but debuggable and without ProGuard
// Used for testing features like G+ and in-app billing where a release config is required
staging {
debuggable true
jniDebugBuild true
signingConfig signingConfigs.release
runProguard false
}
}
productFlavors {
production {
applicationId "my.package.name"
}
internalBeta {
applicationId "my.internalbetapackage.name"
// Beta icons
sourceSets.internalBeta.res.srcDirs = ['res-beta/internal']
}
externalBeta {
applicationId "my.externalbetapackage.name"
// Beta icons
sourceSets.externalBeta.res.srcDirs = ['res-beta/external']
}
testing{
applicationId "my.package.name"
}
}
// Without this, gradle will complain that duplicate files were added to the APK, see:
// http://stackoverflow.com/questions/20673888/duplicate-files-copied-android-studio-0-4-0
packagingOptions {
exclude 'META-INF/LICENSE.txt' // twitter4j
exclude 'META-INF/ASL2.0' // jackson
exclude 'META-INF/LICENSE' // jackson
exclude 'META-INF/NOTICE' // jackson
}
}
task makeTestApks {
dependsOn "assembleProductionRelease"
dependsOn "assembleProductionTest"
}
Wearable Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name">
<uses-feature android:name="android.hardware.type.watch" android:required="false"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".WearReaderActivity"
android:label="MyApp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="my.package.name.READ"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".wear.DataLayerListenerService" >
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
</application>
</manifest>
Wearable build.gradle
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'newrelic'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
minSdkVersion 19
targetSdkVersion 19
versionCode 259
versionName "4.6.1"
}
signingConfigs {
debug {
keyAlias '***'
keyPassword '***'
storeFile file('sameAsHandset/debug.keystore')
storePassword '***'
}
release {
storeFile file("sameAsHandset/android.keystore")
storePassword "***"
keyAlias "***"
keyPassword "***"
}
}
buildTypes {
release {
debuggable true
jniDebugBuild false
signingConfig signingConfigs.release
}
}
productFlavors {
production {
applicationId "my.package.name"
}
internalBeta {
applicationId "my.internalBetaPackage.name"
// Beta icons
sourceSets.internalBeta.res.srcDirs = ['res-beta/internal']
}
externalBeta {
applicationId "my.externalBetaPackage.name"
// Beta icons
sourceSets.externalBeta.res.srcDirs = ['res-beta/external']
}
testing{
applicationId "my.package.name"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':GooglePlay')
compile 'com.newrelic.agent.android:android-agent:3.+'
}
To Answer #odiggity specifically, in build.gradle file of your phone app, you should mention the exact name of the wear app folder. If you created the project in Android Studio, then your build.gradle should look like this:
wearApp project(':wear')
This can happen because of the following reasons:
Wear & Mobile app's "permissions" are not same (Wear App permissions should be a subset of Mobile App permissions).
This is not documented anywhere on developers website, however I found this with my personal experience. The reason I can think of behind this restriction is, Google want to prevent sneaky developers to exploit users & their privacy.
Package name of Wear & Mobile apps are not matching.
VersionNumber & VersionName of both Wear & Mobile app not matching
Application ID (build.gradle file) of Mobile & wear app are not matching.
by default wearable packages are only included in release builds
both apps must be signed with the same key
as of Android Studio 3.0 apk builds created with run are test only builds that don't allow installation on wear (returnCode -15, see this information)
Asset Compression
If you are using Eclipse for development, make sure you turn off the "Asset Compression" otherwise the ".apk" file in raw folder will get double compressed & the phone won't be able to recognize if the Mobile app is packaging wear app or not.
Best Solution:
Use Android Studio.
Create Android Project
Select Phone & Wear project
Follow the steps for project creation
Copy all the permissions used in Wear app to Mobile app's Manifest or vice versa
Debugging
When you don't find the wear app on the wearable you can always look into logs of both devices to see what is going on. You can filter on WearablePkgInstaller to find all logging related to wearable package installation.
From the Wear OS app on you device trigger the "resync apps" option from "advanced settings" and check the logs. Alternative way to sync only the wearable for your app is to reinstall your app. At that point the wearable is also synced for your package.
Device logging should list something like:
11-07 14:58:53.127 3330-8739/? I/WearablePkgInstaller: Setting DataItem to install wearable apps for com.spotify.music
With com.spotify.music being your app Id. This is just an example for Spotify.
And on the watch (debug over bluetooth or USB) you can find logging with this same filter showing issues or success:
11-07 15:00:02.533 1032-1048/? I/WearablePkgInstaller: Package com.spotify.music was installed.
Most error messages are self explanatory. You can find many examples of these errors in the source code of WearPackageInstallerService class. Some however are just a returnCode. For these return codes check the values in this PackageManager source code.
I had ussue with wear product flavors. I had flavors in both handheld and wear apps. To solve my issue I used next code in build.gradle handheld app file:
freeWearApp project(path: ':wear', configuration: 'wearfreeRelease')
fullWearApp project(path: ':wear', configuration: 'wearfullRelease')
where, free and full are flavors from handheld module, wearfree and wearfull are flavors from wear mudule, Release is name of wear module buildtype.
And don't forget publishNonDefault true in the android block of the wear gradle.
I had this problem even after checking the package names, application IDs, and making sure the wear module didn't have any permissions that the handheld module didn't.
My problem was that I was requesting the permission android.permission.BIND_NOTIFICATION_LISTENER_SERVICE in AndroidManifest.xml for the wearable module. It seems that this should only be requested for the handheld module.
as far as I know product flavors are not supported at the moment, either use the manual build (asset or raw) or remove the product flavors.
From my experience it only works when building a signed release build. When deploying a debug build it never installed the wear app for me. With signed release it worked with buildToolsVersion "19.1.0".
In this specific case I can see that you are using "compile project(':GooglePlay')". Is that the latest version? (compile 'com.google.android.gms:play-services-wearable:+')
Just wanted to add something that I haven't seen in many answers.
You have to match the applicationId in your handheld app and wear app.
I previously thought that you needed to have <uses-feature android:name="android.hardware.type.watch" /> in both the handheld and watch manifest, with add: android:required="true" for the wearable manifest and android:required="false" for the device.
THIS IS FALSE. You do not need the above in the handheld manifest. In fact with Wear 2.0 coming up Google has made some changes that will not allow you to upload any apk with minSdk lower than 23 if <uses-feature android:name="android.hardware.type.watch" /> is in your handheld app. Sorry for any confusion.
I've been having this issue recently, and in the end the following fixed it;
Uninstall previous app
Restart Phone
Restart wear
Disconnect and reconnect wear
Re-Sync apps in Android Wear application
And then it popped up on the watch. Before this I tried everything and was convinced the build was not working right
Got the same problem, it turned out that newrelic is instrumenting the Android Wear App. Try to comment the line:
// apply plugin: 'newrelic'
I couldn't find a way to tell newrelic to keep away from the the wear app...
Related
i started with following github projects but these example are not working properly. I added missing parts as stated in the docs.
https://github.com/android/app-bundle-samples/tree/main/InstantApps/urlless
https://github.com/googlecodelabs/android-dynamic-features
Here is the docs i read.
https://developer.android.com/topic/google-play-instant/getting-started/instant-enabled-app-bundle
https://developer.android.com/topic/google-play-instant/feature-module-migration
https://developer.android.com/guide/app-bundle/instant-delivery
i try to implement a simple hello world instant app. I tried many things but try now button never appears in play store.
my app contains 2 module:
app
instant-app
build.gradle of app module :
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 61
versionName "61"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dynamicFeatures = [':instantapp']
}
dependencies {
...
implementation "com.google.android.gms:play-services-instantapps:17.0.0"
implementation "com.google.android.play:core:1.9.0"
...
}
build.gradle of my instant-app module
plugins {
id 'com.android.dynamic-feature'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.test.myapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 3
versionName "1.2"
}
}
dependencies {
implementation "com.google.android.play:core:1.9.0"
}
AndroidManifest.xml of my app module
<?xml version="1.0" encoding="utf-8"?>
<manifest >
<dist:module dist:instant="true" />
...
</manifest>
AndroidManifest.xml of my instant-app module
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.test.instantapp"
android:targetSandboxVersion="2">
<dist:module dist:instant="true" dist:onDemand="false"
dist:title="Instant app title">
<dist:fusing dist:include="true" />
</dist:module>
<application android:usesCleartextTraffic="false">
<activity android:name=".InstantMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I generate a signed bundle and upload it in internal test in each of my try but it did not work. i tried it in prod environment too. Not work!
I tried to put applicationId "com.test.myapp" in both app module and instant-app module. I tried to made android:targetSandboxVersion="2" and android:targetSandboxVersion="1". Not work
.
Version code of my app is greater than version code of my instant-app as shown below.
I removed clearTextTraffic and added. Not work!
Some said me to take my instant app enabled code to take into production and upload a new upgraded instant app version. I did it, it did not work either.
I tried many many combinations which i cannot remember now. But try now button never appears. What is the missing part i cannot find ?
There are 3 different sayings for maximum size of instant-app module:
4 mb
10 mb
15 mb
Why the source codes and docs are conflicting too much and there is no working code in github ? If i didn't see working samples in play store, i would think instant apps are dead.
open play store -> select app-> open advanced settings -> add release type instant app
Then upload your instant app from instant apps only option:
My application was composed of only one application module. I recently tried to split it into 2 modules (a feature base and a application apk one) in order to add later an instant-app module.
My newly created feature module's AndroidManifest and gradle.build contain everything that was inside the previous application module ones:
feature AndroidManifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest package="base.package"
xmlns:android="http://schemas.android.com/apk/res/android">
<!-- all uses-permissions and permissions -->
<application>
<!-- activities, intent-filters... -->
<provider android:authorities="com.facebook.app.FacebookContentProvider663###########"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
<!-- etc -->
</application>
</manifest>
application AndroidManifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest package="app.package"
xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
feature build.gradle :
apply plugin: 'com.android.feature'
android {
buildTypes {
debug {
// debug values
}
release {
// release values
}
}
lintOptions {
checkReleaseBuilds false
}
compileSdkVersion rootProject.compileSdk
defaultConfig {
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}
baseFeature true
}
dependencies {
api "com.android.support:appcompat-v7:$rootProject.supportLib"
application project(':apk')
compile "com.google.firebase:firebase-core:$rootProject.gmsLib"
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
// other dependencies
}
application build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.compileSdk
defaultConfig {
applicationId "app.package"
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(":feature")
}
apply plugin: 'com.google.gms.google-services'
However, although everything builds fine, I have a problem with my APK run configuration:
When I select Default Activity in Launch Options, I get a Default Activity not found warning , and when I select a specific one, I get a The Activity 'XXXX' is not declared in AndroidManifest.xml one.
After some research, I realized this is because of an error with the apk Manifest, that I was able to find by looking at the "Merged Manifest" option. Here is the output:
I couldn't find relevant information to help me about this issue... thanks for any help!
I was able to solve this issue by adding tools:node="replace" in the <application> node of the feature's AndroidManifest. Also, don't forget to add xmlns:tools="http://schemas.android.com/tools" at Manifest top-level.
Try to add these providers in your base module and feature module to fix merge manifest error.
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="{$applicationId}.firebaseinitprovider"
android:exported="(check library provider have exported value true or false)"
tools:node="replace"/>
<provider
android:name="com.facebook.internal.FacebookInitProvider"
android:authorities="{$applicationId}.FacebookInitProvider"
android:exported="(check library provider have exported value true or false)"
tools:node="replace"/>
I've read all the SO questions that are related to this question, but none have helped me solve this problem. I uploaded an early alpha, which supported about 8000+ devices, but the current version supports zero, according to Google Play.
I have only two uses-permission statements, and no uses-feature statements. I've tried removing the uses-permission statements, but (although I get another, different warning about the billing one being absent) I still allegedly support zero devices, even without those.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hearttech.intimacytoolbox" >
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".Application"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_shortname"
android:theme="#style/Theme.NoTitle" >
<activity
android:name=".MainActivity"
android:label="#string/app_shortname"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
[SNIPPED a bunch of other activities from here for length]
</application>
</manifest>
build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'IntimacyToolboxKey'
keyPassword 'fakepassword'
storeFile file('/Users/dave/Dropbox/Intimacy Toolbox/android/Ancillaries/android.jks')
storePassword 'fakepassword'
}
}
compileSdkVersion 23
buildToolsVersion "23"
defaultConfig {
applicationId "com.hearttech.intimacytoolbox"
minSdkVersion 15
targetSdkVersion 23
versionCode 3
versionName '0.2'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
debuggable true
}
}
sourceSets {
main { assets.srcDirs = ['src/main/assets'] }
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('org.simpleframework:simple-xml:2.7.1') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.guava:guava-collections:r03'
compile 'com.google.guava:guava-io:r03'
compile 'com.google.guava:guava-base:r03'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:support-annotations:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'org.apache.directory.studio:org.apache.commons.codec:1.8'
compile 'com.anjlab.android.iab.v3:library:1.0.27'
}
I've seen in places that duplicate libraries can cause this problem, but I haven't added anything outside of the dependency system that uses jcenter. In the gradle log output, it lists only these libraries as having been prepared:
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72300Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareUkCoChrisjenxCalligraphy210Library UP-TO-DATE
I would appreciate any insight as to why Google Play thinks I don't support any devices. Thanks in advance!
So, the problem turned out to be the Apache Commons codec library. I had imported the library using jcentral, the default repository for Android Studio. That worked fine for the other libraries I needed, but for Apache Commons, when uploading the APK that way, Google Play APK uploader lists commons-codec-1.8.jar as a "Native Platform" for the app, which apparently makes the app incompatible with all devices.
To fix the problem, I instead downloaded the .jar file from the Apache Commons website and added it to my [project root]/app/libs directory, and removed the dependency line from gradle.build. This fixed the problem!
Although gradle should do this for you, try adding this in your app manifest.
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="23" />
I'm new to Android Studio (v1.0). I've created a project on it and when I debug or run project from android studio into my Galaxy Nexus phone, I see 2 application icon on application list. And when I uninstall one of them another one also removes. The package name of both are the same.
Is this normal? Maybe I forgot to do some settings.
My build.gradle file looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.aliaa.myapp"
minSdkVersion 9
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
dependencies {
//noinspection GradleCompatible
compile 'com.android.support:gridlayout-v7:21.0.3'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
}
Does Anyone have same experiences?
Check your AndroidManifest.xml file and inspect <activity> entries. Anything with intent filter like this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
will be listed by Launcher as entry point. You usually need one entry point per app.
I have installed crashlytics plugin to android studio 0.9.3; after this I added to my project; It added lines to gradle, first activity and so on...; after this build fails with this error:
Error:Execution failed for task ':app:fabricCleanupResourcesDebug'.
Crashlytics Developer Tools error.
Here is my gradle file, what should I change ? Crashlytics added it's lines automatically:
buildscript {
repositories {
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin : 'com.android.application' apply plugin : 'io.fabric'
repositories {
maven {
url 'https://maven.fabric.io/public'
}
}
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
applicationId "XXXXXXXXXXXXXXXXXXXXXXX"
minSdkVersion 11
targetSdkVersion 19
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.android.support:appcompat-v7:21.0.0'
compile('com.crashlytics.sdk.android:crashlytics:2.1.0#aar') {
transitive = true;
}
}
.
I just had the exact same issue after replacing the API Key in the AndroidManifest.xml file by a string reference instead of a literal string.
Using the literal string, the error disappeared.
Use
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="mykey" />
Don't use
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="#string/crashlytics_api_key" />
I have solved the issue.
I had long conversation with crashlytics team, but they didn't helped me.
My solution is to create separate project, and install crashlytics on that project. It will generate api key on that project. I just copied that key and pasted to my original project and it worked. Have no idea why it didn't generated the key on my initial project.
yes,I add this code in AndroidManifest.xml,it worked
<meta-data
android:name="io.fabric.ApiKey"
android:value="yourapikey" />
On first run of app without internet connection, app can not send information to server, so register your app in server.
This error due to wrong crashlaytics AppKey. Please check your manifest file for confirm it. OR
It is due to use of a string resource instead of Hardcoded AppKey in manifest file.
Use this:
<meta-data
android:name="io.fabric.ApiKey"
android:value="FABRIC_KEY"/>
Dont Use this
<meta-data
android:name="io.fabric.ApiKey"
android:value="#stringFABRIC_KEY"/>
All the best
Open fabric.properties and check if value against apiKey reads YOUR_API_KEY.
If yes then copy your API Key from AndroidManifest.xml and paste it against apiKey in the fabric.properties.