I am making an android app (testing with a physical device running 4.4.4) and every once in a while when I fresh run it or open it if it's already installed then it shows a "Currently unable to download. Please try again later" toast. I'm not downloading anything within the app, I don't use internet, I'm not sure which files are relevant, someone let me know and I can post them. I have no idea where this could be coming from.
The only thing I can think of is possibly SharedPreference is doing something weird? I'll post my gradle at least.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.apps.andapp.appname"
minSdkVersion 19
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.4.0'
compile 'com.google.code.gson:gson:2.7'
}
Related
I used this tutorial: developers.google.com/maps/documentation/android-api/start
This is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.amine.myapplicationmapamine"
minSdkVersion 15
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.3.0'
compile 'com.google.android.gms:play-services:9.8.00'
}
I can see a map in my emulator, but it's not clear and I get this error :
There's not really enough detail to completely answer this, but it's recommended to use the correct version of Google Play Services.
Not sure where you got this line from because that tutorial doesn't use this.
compile 'com.google.android.gms:play-services:9.8.00'
The latest is this. You seem to have an extra 0
compile 'com.google.android.gms:play-services-maps:9.8.0'
Also, there are working sample apps on Github that come from that tutorial that you more or less could copy from.
And I find the configuration page is more "getting started" than the actual start page.
replace :compile 'com.google.android.gms:play-services:9.8.00'
with :compile 'com.google.android.gms:play-services:9.8.0'
I know this has been asked before as well, but I have done all I can.
I have updated all I can from SDK manager, but still I am getting this issue with my project that I just created.
There is no functionality I have given yet, but the issue says the plugin is too old, please update or change the ANDROID_DAILY_ENVIRONMENT variable.
This is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.manav.loginapp"
minSdkVersion 21
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.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
}
Pls help,this is my first app and i have been having serious issues in installing the app on my phone:
After building the apk of my app it takes forever to install on my phone.
I have searched for solutions but none worked for me. My device is huwaie P6 running Jellybean v4,2.
this is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.micheal.stephen.geo"
minSdkVersion 17
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.4.0'
}
pls what might be the problem?
Thank you all, i actually did a phone restart and it worked fine.
I'm creating a simple pro package to unlock features in my free app.
My free app will check if the pro package is installed and unlock pro features if its installed. I created a new project, with no activity. When I pushed it the app to my device it says it's 4 mb in size. Why is it so big when theres no code? Looking at other apps with pro unlockers, they seem very small like 100-200 kb.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.dsmartapps.root.kerneltoolkitunlocker"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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.0.0'
}
Solution:
simply removed compile 'com.android.support:appcompat-v7:22.0.0' and its now 48.00kb.
Probably has to do with the your Gradle build file. It's probably using the support library, if you have no use of it you can remove it.
EDIT:
Even so, as Jared said a single support library shouldn't make your apk size that big. You should check your dependencies and assets to see what makes up for that size.
Here's a simple Gradle file for a new project:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.edd.myapplication"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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:21.0.3'
}
Size with compile 'com.android.support:appcompat-v7:21.0.3': around 900kb.
Size without it: around 22kb.
I am trying to send to send a message from handheld to wear-emulator,
(according to this tutorial).
Unfortunately my WearableListenerService.onMessageReceived doesn't get called.
Here on SO I have read it could be somehow related with gradle.build file,
my gradle.build in 'mobile' module (handheld):
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.benji.data"
minSdkVersion 15
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'])
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:+'
}
my gradle.build in 'wear' module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.benji.data"
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 have everything else set up as it is in the previously mentioned tutorial.
Thanks for any possible answers
Problem relies in modules start order, first launch Handheld module app, and THEN wear emulator app, not vice-versa as I did before :)
It's work for me
If you use Proguard to protect your apk , you need to ensure that the Gson class won't be Proguard, If you use the Gson class
Like this
ProGuard for Android and GSON
Then you must ensure that the apk on your phone and wear must have the same signature, in other word, you need to use the same KeyStore file to export the singed APK.