BottombarNavigationView is not working in kitkat - android

<android.support.design.widget.BottomNavigationView
android:id="#+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
design:menu="#menu/bottom_menu_bar" />
app level gradle.
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 25
buildToolsVersion "25.0.0"
useLibrary 'org.apache.http.legacy'
/*splits {
abi {
enable true
reset()
include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips'
universalApk false
}
}*/
defaultConfig {
applicationId "user.com.hlthee"
minSdkVersion 17
targetSdkVersion 25
versionCode 2
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
res.srcDirs = ['src/main/res', 'src/main/assets/fonts']
}
}
dexOptions {
jumboMode true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
}
}
Theme
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:background">#color/primary_background</item>
<item name="background">#color/primary_background</item>
<item name="android:colorPrimaryDark">#color/primary_background</item>
<item name="colorPrimaryDark">#color/primary_background</item>
<item name="android:navigationBarColor">#color/primary_background</item>
<item name="android:alertDialogTheme">#style/myDialog</item>
<item name="android:datePickerDialogTheme">#style/myDatePickertheme</item>
<item name="android:itemTextAppearance">#style/itemTextStyle.AppTheme</item>
<item name="itemTextAppearance">#style/itemTextStyle.AppTheme</item>
</style>
It is working perfectly fine in api level greater or equal to 21 but it is not working in kitkat. I have even try with the other library but the output is same. I am exactly getting what is the problem with my code.

Related

Could not find method jackOptions() for arguments, why?

when I added
jackOptions {
enabled true
}
I face the error
Could not find method jackOptions() for arguments [build_eu0icfxibozhk3nsdn05m3i57$_run_closure1$_closure3$_closure6#4c9324a1] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=DefaultApiVersion{mApiLevel=14, mCodename='null'}, targetSdkVersion=DefaultApiVersion{mApiLevel=30, mCodename='null'}, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=1, versionName=1.0, applicationId=com.example.myapplication, testApplicationId=null, testInstrumentationRunner=androidx.test.runner.AndroidJUnitRunner, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}, mWearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.
how can I solve it ??
this is the app's build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 14
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
The old Jack compiler has been gone for a couple of years now. Do not add jackOptions to a modern project's Gradle scripts.

How to fix instant app with Android Studio 3.3

I updated to Android Studio 3.3. and also, all SDKs too. Now I cannot run the instant version of my app. I get the following error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':Words:Words:writeAndroidDebugFeatureApplicationId'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:121)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.accept(ExecuteActionsTaskExecuter.java:117)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:184)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ResolveIncrementalChangesTaskExecuter.execute(ResolveIncrementalChangesTaskExecuter.java:84)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:74)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:109)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:94)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:46)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Expected configuration ':Words:Words:androidDebugFeatureMetadataValues' to contain exactly one file, however, it contains no files.
at org.gradle.api.internal.file.AbstractFileCollection.getSingleFile(AbstractFileCollection.java:61)
at com.android.build.gradle.internal.tasks.ApplicationIdWriterTask.fullTaskAction(ApplicationIdWriterTask.kt:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:705)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:672)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$4.run(ExecuteActionsTaskExecuter.java:338)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:327)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:312)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:75)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:158)
at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:46)
at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:49)
at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:42)
at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:28)
at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:133)
at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$5(CacheStep.java:83)
at org.gradle.internal.execution.impl.steps.CacheStep$$Lambda$483/988154824.get(Unknown Source)
at java.util.Optional.orElseGet(Optional.java:267)
at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:37)
at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:95)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:88)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep$$Lambda$416/111798206.apply(Unknown Source)
at java.util.Optional.map(Optional.java:215)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:109)
... 40 more
gradle-wrapper.properties
#Tue Jan 15 12:44:45 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip
It works with the old Android Studio Gradle-4.6 but when I try to roll back I get the message : ERROR: Minimum supported Gradle version is 4.10.1. Current version is 4.6.
dependencies
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
implementation 'com.google.android.gms:play-services-games:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-ads:17.1.3'
api 'com.android.billingclient:billing:1.1';
// Required by Facebook network
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.facebook.android:audience-network-sdk:5.1.0'
implementation 'com.google.ads.mediation:facebook:5.1.0.0'
implementation "com.google.android.instantapps:instantapps:1.0.0"
settings.gradle
include ':ASCore'
include ":Words:Words"
include ":Words:WordsInstant"
include ':Words:WordsInstall'
top-level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules .
buildscript {
ext {
/* Build versions */
minSdkVersion = 16
targetSdkVersion = 28
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
base module build.gradle
apply from: '../../feature.gradle'
apply from: '../version.gradle'
android {
defaultConfig {
// Feature Version = Instant ap version
versionCode VERSION_CODE
versionName VERSION_NAME
resValue "string", "app_id", "XXXXX"
manifestPlaceholders.appClass = APPLICATION_ID + ".App"
}
}
apply plugin: 'com.google.gms.google-services'
instant module build.gradle
apply plugin: 'com.android.instantapp'
apply from: '../version.gradle'
android {
defaultConfig {
applicationId APPLICATION_ID
manifestPlaceholders.appClass = APPLICATION_ID + ".App"
setProperty("archivesBaseName", "$APPLICATION_ID-$VERSION_CODE")
}
}
dependencies {
implementation project(':Words:Words')
}
app.gradle
apply plugin: 'com.android.application'
android {
buildToolsVersion rootProject.ext.buildToolsVersion
lintOptions {
disable 'MissingTranslation'
}
flavorDimensions "type"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
//multiDexEnabled true // enable for the MediationTestSuite
resValue "string", "AS_BUILD_TIMESTAMP", "\"" + System.currentTimeMillis() + "\""
}
signingConfigs {
AsgardKey {
keyAlias 'XXX'
keyPassword 'XXX'
storeFile file("XXX")
storePassword 'XXX'
v2SigningEnabled true
}
AsgardKeyDev {
keyAlias 'XXX'
keyPassword 'XXX'
storeFile file("XXX")
storePassword 'XXX'
v2SigningEnabled true
}
}
buildTypes {
debug {
resValue "bool", "IS_DEBUG", "true"
signingConfig XXX
}
release {
resValue "bool", "IS_DEBUG", "false"
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), "$rootProject.projectDir/proguard-rules.pro"
signingConfig XXX
}
}
productFlavors {
play {
dimension 'type'
buildConfigField 'boolean', 'IS_PRO', 'false'
}
}
bundle {
density.enableSplit = true
abi.enableSplit = true
language {
enableSplit = true
}
}
applicationVariants.all { variant ->
if (variant.buildType.name.equals("release")) {
variant.outputs.all { output ->
outputFileName = "${applicationId}-${versionCode}-${variant.flavorName}.apk"
}
}
if (variant.getBuildType().isMinifyEnabled()) {
variant.assemble.doLast {
copy {
from variant.mappingFile
into variant.outputs[0].outputFile.parent
rename { String fileName ->
"${applicationId}-${versionCode}-${variant.flavorName}-mapping.txt"
}
}
}
}
}
}
dependencies {
implementation project(':ASCore')
}
apply from: "$rootProject.projectDir/dependencies.gradle"
feature.gradle
apply plugin: 'com.android.feature'
android {
buildToolsVersion rootProject.ext.buildToolsVersion
baseFeature true
lintOptions {
disable 'MissingTranslation'
}
flavorDimensions "default"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
resValue "string", "AS_BUILD_TIMESTAMP", "\"" + System.currentTimeMillis() + "\""
}
signingConfigs {
AsgardKey {
keyAlias 'XXXX'
keyPassword 'XXXX'
storeFile file("XXXX")
storePassword 'XXXX'
v2SigningEnabled true
}
AsgardKeyDev {
keyAlias 'XXXX'
keyPassword 'XXXX'
storeFile file("XXXX")
storePassword 'XXXX'
v2SigningEnabled true
}
}
buildTypes {
debug {
resValue "bool", "IS_DEBUG", "true"
signingConfig XXXX
}
release {
resValue "bool", "IS_DEBUG", "false"
minifyEnabled false
debuggable false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), "$rootProject.projectDir/proguard-rules.pro"
signingConfig XXXX
}
}
productFlavors {
android {
buildConfigField 'boolean', 'IS_PRO', 'false'
}
}
bundle {
density.enableSplit = true
abi.enableSplit = true
language {
enableSplit = true
}
}
}
dependencies {
implementation project(':ASCore')
}
apply from: "$rootProject.projectDir/dependencies.gradle"
How I can fix this issue?
Regards
Ronald
My current working solution
Remove apply plugin: 'com.google.gms.google-services' from my base module. In the old version was this necessary to get firebase analytics working.
Now I use the aab package format with instant app support:
https://developer.android.com/topic/google-play-instant/getting-started/instant-enabled-app-bundle
and modify my AndroidManifest.xml
<manifest ... xmlns:dist="http://schemas.android.com/apk/distribution">
<dist:module dist:instant="true" />
...
</manifest>
Android Studio show the warning
The option setting 'android.injected.deploy.instant-app=true' is
experimental and unsupported.
but it works with Google Play Store, Play Services and Firebase :-)
Regards
Ronald

Google Play - 0 Supported Devices Issue

Can anyone help me to solve Google Play - Zero Supported Devices issue. Below is the my AndroidManifest file.
-->
<uses-permission android:name="com.myapp.permission.C2D_MESSAGE"/>
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
<application
android:name=".MyApplication"
android:allowBackup="false"
android:fullBackupContent="true"
android:hardwareAccelerated="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme">
I have tried below options
Google Play - Zero Supported Devices
Zero supported devices results on google play store
build.gradle file structure is as below,
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply from: '../config/quality.gradle'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}
def versionMajor = 0
def appVersionCode
def versionMinor
def versionDate = "${buildTime()}"
def buildTime() {
return new Date().format("YYMMdd", TimeZone.getTimeZone("UTC"))
}
def versionPropsFile = file('../config/quality/version.properties')
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
/*if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def value = 0
def runTasks = gradle.startParameter.taskNames
logger.info('Value Code - ' + runTasks)
if ('assemble' in runTasks || 'assembleRelease' in runTasks || 'aR' in runTasks) {
value = 1;
}
logger.info('Value Code - ' + value)
appVersionCode = versionProps['VERSION_CODE'].toInteger() + value
versionMinor = versionProps['DAY_COUNT'].toInteger()
def buildDate = versionProps['DATE'].toString()
if (buildDate != versionDate) {
versionMinor = 1
} else {
versionMinor = versionMinor + 1;
}
versionProps['VERSION_CODE'] = appVersionCode.toString()
versionProps['DAY_COUNT'] = versionMinor.toString()
versionProps['DATE'] = versionDate.toString()
versionProps.store(versionPropsFile.newWriter(), null)
} else {
throw new GradleException("Could not read version.properties!")
}*/
defaultConfig {
applicationId "com.myappe"
minSdkVersion 14
targetSdkVersion 23
versionCode 11
versionName "4.0"
}
aaptOptions {
useNewCruncher true
}
signingConfigs {
release {
storeFile file("../config/keystore/myapp_app.jks")
storePassword "myappapp"
keyAlias "myappApp"
keyPassword "myappapp"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled false
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled false
multiDexEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':myapplibrary')
compile('com.crashlytics.sdk.android:crashlytics:2.5.0#aar') {
transitive = true;
}
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar'
compile 'me.relex:circleindicator:1.2.1#aar'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.firebase:firebase-core:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
It's Google bug :(
I have verified this for 4-5 apps.
Bug Description :
Whenever new version of app is publishing on Android play store and once APK is uploaded then in APK description it always show Supported Android Devices count 0 Devices.

String types not allowed (at 'blue' with value '')

I am getting following error in appcompat-v7 library building the project.
Error:(380, 5) String types not allowed (at 'blue' with value '').
\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values\values.xml
appcompat-v7 library values.xml file where this error is occuring:
<!-- this line --> <style name="Base.TextAppearance.AppCompat.SearchResult" parent="">
<item name="android:textStyle">normal</item>
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textColorHint">?android:textColorHint</item>
</style>
I have latest version of Android Studio (2.0 Preview 7) and appcompat-v7 library.
build.gradle:
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig.with {
applicationId "com.ms.sensors"
minSdkVersion.apiLevel 7
targetSdkVersion.apiLevel 23
versionCode 1
versionName "1.0"
}
compileOptions.with {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
}
}
}
android.ndk {
moduleName = "sensorgraph"
cppFlags.add("-Werror")
ldLibs.addAll(["log", "GLESv2", "android"])
stl = "c++_static"
}
android.productFlavors {
create("arm7") {
ndk.abiFilters.add("armeabi-v7a")
}
create("arm8") {
ndk.abiFilters.add("arm64-v8a")
}
create("x86-32") {
ndk.abiFilters.add("x86")
}
// for detailed abiFilter descriptions, refer to "Supported ABIs" #
// https://developer.android.com/ndk/guides/abis.html#sa
// build one including all cpu architectures
create("all")
}
}
dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
}
My style.xml:
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
</resources>
You assign empty value to 'blue'
open your color.xml then search for 'blue' and check you assigned color
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue"></color> <!-- must add valid value -->
</resources>

Android studio doesn't find theme with custom gradle configuration for testing

Im trying to do tests in my android application. I have this build.gradle for the root:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
configure(allprojects) { project ->
buildscript {
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
mavenLocal()
}
}
}
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
group = 'com.firext.android'
ext.androidBuildToolsVersion = '19.1.0';
ext.androidMinSdkVersion = 18;
ext.androidCompileSdkVersion = 19;
ext.androidTargetSdkVersion = 19;
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "file://${System.getenv("ANDROID_HOME")}/extras/android/m2repository" }
mavenLocal()
}
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
apply plugin: 'java'
And this for the build.gradle project module:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:0.11.+'
}
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':libraries:AndroidBootstrap')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:3.1.+'
compile 'com.github.pedrovgs:renderers:1.0.9'
compile 'com.jakewharton:butterknife:5.0.1'
compile 'com.etsy.android.grid:library:1.0.4'
compile 'ch.acra:acra:4.5.0'
compile 'com.loopj.android:android-async-http:1.4.4'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
compile 'com.android.support:support-v4:+'
androidTestCompile 'com.google.guava:guava:14.0.1',
'com.squareup.dagger:dagger:1.1.0',
'org.hamcrest:hamcrest-integration:1.1',
'org.hamcrest:hamcrest-core:1.1',
'org.hamcrest:hamcrest-library:1.1',
'com.jakewharton.espresso:espresso:1.1-r2'
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
signingConfigs {
release {
//Omitted
}
debug {
testCoverageEnabled = true
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs += 'src/gen'
res.srcDirs = ['res']
}
test {
java.srcDir file('src/test/java')
resources.srcDir file('src/test/resources')
}
androidTest.setRoot('.')
androidTest {
java { srcDirs = [
'src/test/java'
] }
res.srcDirs = ['res']
assets.srcDirs = [
'assets'
]
resources.srcDirs = [
'src'
]
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
productFlavors {}
}
This in the manifest:
<application
android:allowBackup="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/FirextTheme"
android:name=".FirextApplication">
And this in the styles:
<resources>
<style name="CustomDialog" parent="android:Theme.Holo.Light.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowIsFloating">false</item>
</style>
<style name="FirextTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/ActionBar</item>
</style>
<style name="ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#D30000</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#ffffff</item>
<item name="android:displayOptions">useLogo|showHome</item>
</style>
</resources>
And when i do a sync i get this error:
Error:(29, 24) No resource found that matches the given name (at 'theme' with value '#style/FirextTheme').
Before of this i had a default build.gradle and worked ok, but now dont..Whats wrong?
You should have add defaultConfig to android section:
android {
compileSdkVersion ext.androidCompileSdkVersion
buildToolsVersion ext.androidBuildToolsVersion
defaultConfig {
minSdkVersion ext.androidMinSdkVersion
targetSdkVersion ext.androidTargetSdkVersion
}
}
The Holo is available only from 4.0. If you need to support older versions you have to use AppCompat or ActionBarSherlock
Can you change your style.xml to:
<style name="FirextTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/ActionBar</item>
</style>

Categories

Resources