I am working on a watch app which also has a handheld app. Requirement is that watch app should install automatically onto watch once app is installed on the phone. But unfortunately, I am not able to get that done.
I know I need to do a release APK. I have been trying to do same but still not able to get it done. I also uploaded app on google play store to see if that can help me but still no luck can anyone let me know what I am doing wrong. Have been stuck on this for last few weeks any kind of help will be really appreciated.
Here is my Phone app gradle
compileSdkVersion 25
buildToolsVersion "25.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
// office id
applicationId "appid"
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
versionCode 8
versionName "1.0.7"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':ImageGrid')
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:10.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.tf.library.tabs:tftabs:2.1.0'
compile 'com.soundcloud.android:android-crop:1.0.1#aar'
compile 'com.shaishavgandhi:login-buttons:0.1.1'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'it.sephiroth.android.library.picasso:picasso:2.5.2.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:gridlayout-v7:25.3.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
//CHAT UI
compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.3'
// AUTH
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'
//DATABASE FIREBASE,UI
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
//STORAGE FIREBASE
compile 'com.google.firebase:firebase-storage:10.0.0'
//Places SERVICES
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.0'
compile 'com.google.firebase:firebase-crash:10.0.0'
compile 'com.android.support:multidex:1.0.0'
// compile 'com.google.android.gms:play-services-maps:9.6.1'
// compile 'com.google.android.gms:play-services:8.4.0'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.victor:lib:1.0.1'
compile 'com.github.myinnos:AwesomeImagePicker:1.0.1'
compile 'com.adityak:browsemyfiles:1.4'
compile 'id.zelory:compressor:1.0.4'
compile files('libs/aspectjrt-1.7.3.jar')
compile files('libs/isoparser-1.0.6.jar')
}
And this is my wear app gradle file
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "appid"
minSdkVersion 18
targetSdkVersion 22
versionCode 7
versionName "1.0.6"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v13:25.3.1'
provided 'com.google.android.wearable:wearable:2.0.3'
compile 'com.google.android.support:wearable:2.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.google.android.gms:play-services-wearable:10.0.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
}
Just to make sure it work I have package name for both app and wearable same
Please help me on this.
Thank you
As stated in this thread, try to check your permissions. The Smartphone part needs to have all the permissions the Wear component has.
You may also check this post for reference.
...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.
Package name of Wear & Mobile apps are not matching.
Application ID (build.gradle file) of Mobile & wear app are not matching.
Asset Compression
Hope this helps!
Related
I have been developing apps using firebase for over an year now. Today when I open Android Studio suddenly all my projects built on Firebase are throwing the following error:
Error:Could not find firebase-auth-license.aar (com.google.firebase:firebase-auth-license:12.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/firebase/firebase-auth-license/12.0.1/firebase-auth-license-12.0.1.aar
Tried fixing it with many things like updating sdk build tools, google play services etc but still getting same error.
Following is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "**********",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
applicationId "*****"
minSdkVersion 19
targetSdkVersion 26
resConfig("en")
versionCode 11
versionName "2.21"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// testCompile 'junit:junit:4.12'
// compile 'com.google.firebase:firebase-ads:9.4.0'
// Single target that includes all FirebaseUI libraries
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile project(':checkbox')
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-vector-drawable:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:animated-vector-drawable:26.+'
compile 'com.android.support:customtabs:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.firebaseui:firebase-ui:0.4.4'
compile 'com.squareup.leakcanary:leakcanary-android:1.5'
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.master.android:permissionhelper:1.3'
compile 'com.stone.vega.library:VegaLayoutManager:1.0.2'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
}
apply plugin: 'com.google.gms.google-services'
To solve this, please change the following lines of code:
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1
compile 'com.google.android.gms:play-services-base:10.0.1'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.firebaseui:firebase-ui:0.4.4'
to
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.4
implementation 'com.google.android.gms:play-services-base:16.0.1'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
In your top level build.gradle file please be sure to have the latest version of Google Service plugin:
classpath 'com.google.gms:google-services:4.1.0'
The culprit was compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'.
I just replaced it with compile 'com.onesignal:OneSignal:[3.9.1, 3.99.99]' and now everything is fine.
I am currently having some trouble running my project.
duplicate entry: com/google/android/gms/internal/zzai$zza.class
The error is saying that I have a duplicate dependency, but I can't see a duplicate anywhere!
The error appears on this line of code:
compile 'com.google.android.gms:play-services-ads:8.4.0'
It says that it has found versions 9.8 and 8.4. I only see version 8.4 though.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.tedrasoft.templategoogle"
minSdkVersion 15
targetSdkVersion 23
versionCode=7
versionName="1.6"
multiDexEnabled true
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "ed282ffa-1e9e-4dd8-9edc-cfdcbe8376bd",
onesignal_google_project_number: "3902815545"]
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile files('libs/chartboost.jar')
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.facebook.android:audience-network-sdk:4.+'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-location:+'
compile files('libs/jackson-annotations-2.1.0.jar')
compile files('libs/jackson-core-2.1.0.jar')
compile files('libs/jackson-databind-2.1.0.jar')
}
In my case, it's because of the
compile 'com.facebook.android:audience-network-sdk:4.+'
I change it to this:
compile ('com.facebook.android:audience-network-sdk:4.+'){
exclude group:"com.google.android.gms"
}
No more problem!
Make these versions match... so 8.4.0, not + which pulls the latest 9.8 I think, now?
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-location:+'
Also, these are 1) unneccessary lines (because of compile fileTree), and 2) you should make them like the others and not use jar files.
compile files('libs/jackson-annotations-2.1.0.jar')
compile files('libs/jackson-core-2.1.0.jar')
compile files('libs/jackson-databind-2.1.0.jar')
Upgrade google play services (maps, location and gcm) from 9.0.0 to 9.2.0
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
Then add this dependency:
compile 'com.google.android.gms:play-services-places:9.2.0'
I am getting gradle issue .
here is below issue in gradle message, while doing sync in gradle
Our Android Studio version is 2.1.2.
Error:A problem occurred configuring project ':LetMeCall_Store'.
Could not find support-v4.jar (com.android.support:support-v4:24.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/24.1.1/support-v4-24.1.1.jar
Below is gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.app.letmecall.store"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.android.support:support-v4:24.0.0-beta1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.0.0-beta1'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.daimajia.androidanimations:library:1.0.3#aar'
compile "com.google.android.gms:play-services:8.3.0"
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:multidex:1.0.0'
}
Plz anyone help us to fix that issue
Advance thanks
I upgraded all my Android SDK tools (including "Support Repository"), however, I still got the error
Gradle sync failed: Could not find recyclerview-v7.jar (com.android.support:recyclerview-v7:24.1.1)
I then did the following :
targetSdk 24 (was 23)
buildToolsVersion: "24.0.3" (was 24.0.0)
deleted the folders within /.gradle/caches I have windows and the complete path is C:\Users\USERNAME\.gradle\caches
THEN the project built without error !!
Change this
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.android.support:support-v4:24.0.0-beta1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.0.0-beta1'
to this
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
you have to use same version.
Replace with these
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.stackdemo"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.daimajia.androidanimations:library:1.0.3#aar'
compile "com.google.android.gms:play-services:8.3.0"
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:multidex:1.0.0'
}
I have the same issue and once i update Build tool version and android studio. Issue is resolved. Defiantly it is due to older build tool version.
I had this issue with a sample project from Android Developers. I updated all of the libraries in. the gradle file to latest versions then cleaned & rebuilt the project. All is working fine now.
Probably a good idea to make sure all of your sdk's are up to date too
My Android app is working perfectly up to Lollipop. But it is hanging in Marshmallow.
When I open the app,back to home button,again open the app. It hangs. I have used all these libraries:
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.google.android.gms:play-services-analytics:9.0.2'
compile "com.google.android.gms:play-services:9.0.2"
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.android.support:multidex:1.0.0'
And i use :
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.appid"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
What time of exception are you getting?
Check to see if you're requesting any of these permissions: https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous
If you are, then you will have to specifically request them using requestPermissions
I have found the solution.
I have just updated libraries to the latest libraries ie
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.mcxiaoke.volley:library:1.0.1'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile "com.google.android.gms:play-services:9.2.0"
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.android.support:multidex:1.0.1'
Since i haven't use dangerous permission i dont need to handle on runtime.
Even after adding the dependencies and importing the class I am getting java.lang.NoClassDefFoundError: com.squareup.okhttp.logging.HttpLoggingInterceptor.
Can anyone please help?
Gradle Build file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "xyz"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
}
In my case, I found that the versions of the okhttp3 and okhttp3:logging-interceptor dependencies needed to exactly match. So for example:
...
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
...
Could be a compatibility problem with retrofit.
Try with :
implementation 'com.squareup.okhttp:logging-interceptor:2.5.0'
This post could be help
App crash on HttpLoggingInterceptor
Also it can be connected with multidex true option in your build.gradle (yes, seems like some devices have problems with multidex apps (read, Samsung))
If this is your case, switch this flag off and rebuild your project. Consider using
minifyEnabled true
shrinkResources true
to reduce your apk size. If it is still too large, that's really weird and bad news, but there are some techniques to put your apk on diet.