So far
I am developing a watch face app for android wear.
I have created 2 modules:
Wear - The Watch face that works fine on development
Mobile - An empty module with no activity as suggested by the comments
I have added the wear module to the mobile as a dependancy as described in packaging wear apps for the playstore
The app is in alpha in the playstore. I have uploaded the mobile-release.apk.
The app installs fine on my mobile but the wear module, the WatchFace will not install on my wear device. This is my problem.
What am I doing wrong?
Here are my manifests and Gradle configs
Mobile Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dimitrioskanellopoulos.athletica">
<uses-permission android:name="android.permission.BODY_SENSORS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application android:allowBackup="true" android:icon="#mipmap/ic_launcher"
android:label="#string/app_name" android:supportsRtl="true"
android:theme="#style/AppTheme">
</application>
Wear Manifest
<service
android:name="com.dimitrioskanellopoulos.athletica.WatchFaceService"
android:label="#string/app_name"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="#drawable/preview_rectangular" />
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="#drawable/preview_circular" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
Build.gradle for the Project
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle for the mobile module
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.dimitrioskanellopoulos.athletica"
minSdkVersion 22
targetSdkVersion 23
versionCode 4
versionName "1.0.2"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
wearApp project(':wear')
}
Build.gradle for the wear module
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.dimitrioskanellopoulos.athletica"
minSdkVersion 22
targetSdkVersion 23
versionCode 4
versionName "1.0.2"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.google.android.support:wearable:1.4.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
compile 'org.apache.commons:commons-lang3:3.4'
}
Any help would be much appreciated!
Well after some time it installed. Took several uninstalls/installs.
The updated manifests are result of the comments and thanks for that.
Related
I just backed to my old project as I have been along time didn't work on it and I found a lot of errors as a build error in gradle as I use the compile instead implementation and many other process I tried to solve this error a lot but I failed as this my window error that's I couldn't recognize as I used also old Libraries from github
this is myGradle (build.gradle(Project:Waiterer))
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "abtech.waiteriano.com.waitrer"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(':jtds-1.3.1')
implementation project(':library')
implementation project(':librarySV')
implementation 'com.android.support:support-v4:25.2.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:25.3.1'
implementation 'com.roughike:bottom-bar:1.3.9'
implementation 'com.android.support:recyclerview-v7:25.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:cardview-v7:25.3.1'
testImplementation 'junit:junit:4.12'
implementation "com.android.support:gridlayout-v7:23.1.1"
}
and this my first gradle library I use
build.gradle(Module:library)
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
}
and this is my second library I use
build.gradle(Module:librarySV)
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.8.1'
}
}
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.4.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
implementation 'com.android.support:design:23.1.1'
}
publish {
userOrg = 'miguelcatalan'
groupId = 'com.miguelcatalan'
artifactId = 'materialsearchview'
publishVersion = '1.4.0'
desc = 'Cute library to implement SearchView in a Material Design Approach'
website = 'https://github.com/MiguelCatalan/MaterialSearchView'
}
hope this could be clear enough If any some thing not clear tell me
Note that: I am not using API I use JDBC JTDS Connection to retrieve data from data base
Thing is developers are not comfortable to new AS still. Way of showing error is changed (is weird now).
First scroll to down in build errors. If you see an error, click to expand it. It will show you error most probably.
Second If that does not work (like i faced in data binding, where no errors were shown)
Then try build with debug or stacktrace
Go to
File > Settings > Build, Execution, Deployment > Compiler
add like this (add --stacktrace or --debug), it will log the exceptions. You can see what is causing issue.
Okay, so the problem is with the AndroidManifest in your app module:
<activity android:name=".Main2Activity">
<service
android:name="SoftKeyboard"
android:permission="android.permission.BIND_INPUT_METHOD"
tools:ignore="WrongManifestParent">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="#xml/method" />
</service>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
According to the documentation the 'service' element must be nested under 'application' not 'activity'. So change that part of code to:
<activity android:name=".Main2Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="SoftKeyboard"
android:permission="android.permission.BIND_INPUT_METHOD"
tools:ignore="WrongManifestParent">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="#xml/method" />
</service>
This will fix the error you are getting from AAPT2. For your project to build successfully you will also need to update your dependencies as described here. If you do both, everything should build correctly. :)
I'm having an issue with this google play services plugin. It is telling me to update from the current version to a previous one. I have looked at other threads on here and they all say to put the plugin at the end of the app based gradle, which I already did, but I am still getting the error.
Here is my manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mikediloreto.findingrestaurants">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:name=".MyApplication"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ProfileActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
And here is the app-based gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.mikediloreto.findingrestaurants"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
Here is the project based build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please let me know if you would like me to include any other code.
First of all here is something u shouldnt do
compile 'com.google.android.gms:play-services-maps:11.0.4'
and
compile 'com.google.android.gms:play-services-auth:9.2.1'
its a good practice to have on global variable for libs having the same versions
then u could do something like
compile "com.google.android.gms:play-services-auth:$google_ver"
might be that 11.xxx nd 9.xxx versions r cosing the trouble. Try using 11.0.4 instead of 9.2.1
for the first time I am using google maps in my android studio project I have added the dependency in my project but i ma geeting error
Here is all the code from build.gradle(project:Location) file of my project
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
here is the all the code from build.gradle(Module.app) file of my project
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.anonymous.location"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.google.android.gms.play-services:+7'
testCompile 'junit:junit:4.12'
}
Here is the all code from my AndroidMenifest.xml file of my project
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.anonymous.location">
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/
google_play_services_version"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
compile 'com.google.android.gms.play-services:+7'
it should be-
compile 'com.google.android.gms:play-services:7+'
but you should avoid inexact versions, use more specific like "9.4.0" or whatever suits your application.
https://developers.google.com/android/guides/releases check here for the versions. check what functionality you want and use that version code. Also note the different variant of play-services are available.
Like Arnav said, you have to use -
compile 'com.google.android.gms:play-services:7+'
Adding to that, if you want to check the latest dependency for any library,
use this - Check latest version of any library
I am new to Android and new to this forum as well. I have done an Android app and it is running fine in Android Lollipop and Marshmallow. However when I try to open my app from Android Kitkat, the app is not opening up. Its suddenly closing by itself. I am of the feeling the it is due to the improper minSdkVersion and targetSdkVersion. My build.gradle is as below:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'XX'
keyPassword 'XXX777'
storeFile file('C:/Users/XXX/XXXXX.jks')
storePassword 'XXX777'
}
}
compileSdkVersion 23
buildToolsVersion '24.0.2'
defaultConfig {
applicationId "com.fire.firebasetest.testone"
minSdkVersion 19
targetSdkVersion 23
versionCode 4
versionName "4.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
// volley
// Glide
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.android.gms:play-services:9.6.0'
compile 'com.google.firebase:firebase-messaging:9.6.0'
}
apply plugin: 'com.google.gms.google-services'
My app has a splash screen on start and its not opening up in Kitkat 4.4.
My manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name=".AppController"
android:allowBackup="true"
android:icon="#drawable/ic_launcher_new"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Can someone help me out to solve this issue?
I am working on an android app and it started opening late.
04-16 18:07:09.834 2683-2683/pp.com.dersProgramim W/ResourceType: Found multiple library tables, ignoring...
04-16 18:07:23.159 2683-2683/pp.com.dersProgramim D/NotificationMan...: Step 1
Here is the logcat in first run. It waits so long to open in "Found Multiple Library tables, ignoring" part. Its like 12 seconds.
After the first run, app makes big size cache and data, like 30 MB.
App Info
Its so big i think.
And the second run for example, app opens late again in "Found Multiple library tables, ignoring..." part, it waits too, but not as first run, it is 15 ms.
Here is the build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "pp.com.dersProgramim"
minSdkVersion 14
targetSdkVersion 23
versionCode 10
versionName "2.0.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile project(':BetterPickers')
compile project(':MaterialDesign')
compile project(':UpdateChecker')
compile 'com.google.android.gms:play-services:6.+'
compile 'com.balysv.materialmenu:material-menu-toolbar:1.5.1'
compile 'de.cketti.library.changelog:ckchangelog:1.2.2'
compile('com.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.prolificinteractive:material-calendarview:1.1.0'
}
manifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="pp.com.dersProgramim">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application android:allowBackup="true" android:label="#string/app_name"
android:name=".MySchoolSchedule"
android:icon="#mipmap/ic_launcher" android:supportsRtl="true"
android:theme="#style/DersProgramimTheme">
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:exported="true"
android:theme="#style/DersProgramimTheme"
android:configChanges="orientation|screenSize|touchscreen"
android:windowSoftInputMode="stateUnchanged|stateHidden|adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SetSchuleTimeConfigurationActivity"
android:label="#string/app_name"
android:theme="#style/DersProgramimTheme"
android:configChanges="orientation|screenSize|touchscreen"
android:windowSoftInputMode="stateUnchanged|stateHidden|adjustPan"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:theme="#android:style/Theme.Translucent"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<receiver android:name=".StartReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name=".NotificationService" />
</application>
</manifest>
And other module's build.gradle files
buildscript {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-beta1'
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
apply plugin: 'android-library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionName "1"
versionCode 1
}
buildTypes {
release {
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.0.1'
compile('com.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
}
And other one
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.+'
compile 'com.nineoldandroids:library:2.4.0'
compile fileTree(dir: 'libs', include: '*.jar')
}
And this is the last
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 10
versionName "1.5.5"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
assets {
srcDir 'assets'
}
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.0.1'
compile 'org.jraf:android-switch-backport:1.4.0#aar'
compile 'com.nineoldandroids:library:2.4.0'
}
Thanks for your help guys.
yeah, I got this problem too
But the problem solved when I build a released apk.
Maybe you can try to build a released apk.
I guess there might be some problem in the debug apk.