React native build failed for android RN 0.57.1 - stripe-payments

I have read the installation guide and setup everything. Payment is working fine with iOS but android is still failed. I have used everything to fix the issue but still facing the same issue.
android/build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "17.0.0"
}
}
package.json
"react": "16.5.0",
"react-native": "0.57.1",
"tipsi-stripe": "^8.0.0-beta.4",
android/app/build.gradle
implementation 'com.android.support:design:27.1.0'
compile project(':tipsi-stripe')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
Androidmanifest.xml
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
But the android build failed everytime and i tried everything to resolve this nothing worked.
Here is my issue:
> Task :tipsi-stripe:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
error: resource style/Theme.MaterialComponents.Light.DarkActionBar (aka com.app.customer:style/Theme.MaterialComponents.Light.DarkActionBar) not found.
error: resource style/Theme.MaterialComponents (aka com.app.customer:style/Theme.MaterialComponents) not found.
error: resource style/Widget.MaterialComponents.Button.TextButton (aka com.app:style/Widget.MaterialComponents.Button.TextButton) not found.
error: resource style/Widget.MaterialComponents.Button (aka com.mybeautysquad.customer:style/Widget.MaterialComponents.Button) not found.
error: resource style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense (aka com.app:style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense) not found.
/Users/admin/.gradle/caches/transforms-2/files-2.1/6b75366950aa0bad3a0940bb5e9e84dd/res/values/values.xml:87:5-65: AAPT: error: style attribute 'attr/boxBackgroundColor (aka com.app.customer:attr/boxBackgroundColor)' not found.
error: failed linking references.
Please let me know if anyone can help me into this. It's very important to resolve this issue because iOS app is working fine the only android still live with old version.

try changing this
implementation 'com.android.support:design:27.1.0'
to
implementation 'com.android.support:design:28.0.0'
also
targetSdkVersion = 27
change it to
targetSdkVersion = 28
do a clean build and try again.
Let me know if that works.

Related

How to fix AAPT: error: resource android:attr/fontVariationSettings not found?

I have seen this issue on several platforms, anyone knows what is it and how to fix it?
The error message:
AAPT: error: resource android:attr/fontVariationSettings not found.
AAPT: error: resource android:attr/ttcIndex not found.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processReleaseResources'.
Failed to process resources, see aapt output above for details.
build gradle:
android {
compileSdkVersion 27
defaultConfig {
applicationId "app name"
minSdkVersion 16
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}
pubspec:
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_markdown: ^0.2.0
share: ^0.5.3
intl: ">=0.14.0"
shared_preferences: ^0.4.3
rxdart: ^0.19.0
url_launcher: ^4.0.1
In case someone has the same issue, it was a problem in package compatibility, in this case, was the obsolete shared preferences.

ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.prop

I want to use firebase remote config library(com.google.firebase:firebase-config:19.1.4). When I add its dependency into app gradle, I'm getting following error.
ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.versionedparcelable:versionedparcelable:1.0.0, androidx.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.core:core:1.0.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
Affected Modules: app
My app gradle is as follows:
android {
compileSdkVersion 27
defaultConfig {
applicationId "in.co.gramafone.client"
minSdkVersion 16
targetSdkVersion 27
versionCode 19
versionName "1.1.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
...
}
I'm extensively using android support libraries(com.android.support:appcompat-v7:27.1.1). So, if I'm enabling androidX by putting below lines to solve this, there are a lot of other library conflicts are reporting(I can post if those errors are necessary)
android.useAndroidX=true
android.enableJetifier=true
Please let me know if any other information is necessary to understand the actual issue.
NB:I'm a newbie in the world of android
android.useAndroidX=true
android.enableJetifier=true
You need to add these to your gradle.properties file in your Gradle Scripts Folder.
I am not 100% sure, but this should work.
first Open your Project gradle scripts>> then open gradle.properties And Finally paste this two line code
android.useAndroidX=true
android.enableJetifier=true

Tipsi stripe not working with android react native

I am working in RN 0.57.1 and because of stripe latest updates i need to upgrade my stripe package. App is working fine with iOS build but the android build failed regular, I am totally confused here how to fix this.
Here is my build.gradle code:
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "17.0.0"
}
Here is Error:
Task :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/admin/.gradle/caches/transforms-2/files-2.1/847adf56c6204cd8db834c9987a748e4/stripe-3ds2-android-1.2.2/res/values/values.xml:84:5-86:13: AAPT: error: style attribute 'attr/boxBackgroundColor (aka com.mybeautysquad.customer:attr/boxBackgroundColor)' not found.
Please let me know if anyone can help me into this...Thanks!
I solved this on the latest version of RN using a very similar set up as you.
https://github.com/tipsi/tipsi-stripe/issues/504#issuecomment-583566852

Updated Android Studio - many errors now

I was loading an old project into Android Studio. Android Studio asked to update which I allowed.
However - now I get error
build failed 10s 30ms Run build 9s 822ms Load build 10ms Configure
build 413ms Calculate task graph 566ms Run tasks 8s 826ms null
C:/Users/my
name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values-v26/values-v26.xml
C:/Users/my
name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values-v28/values-v28.xml
W:/android-studio-projects/sharedid C:/Users/my
name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values/values.xml null failed linking references.
"Run tasks" log is
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:processDebugResources'. at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at
org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at
org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at
org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at
org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at
org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at
org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at
org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at
org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at
org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at
...
In my
W:\android-studio-projects\sharedid\app\src\main\AndroidManifest.xml
file I have
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="25"
/>
...
In my
W:\android-studio-projects\sharedid\app\build.gradle
file I have
compileSdkVersion 25
and
dependencies {
api 'com.google.android.gms:play-services-maps:+'
api 'com.google.android.gms:play-services-location:+'
api 'com.android.support:appcompat-v7:+'
api 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
also tried
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-location:+'
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
here is the whole file
android {
defaultConfig {
applicationId "com.example.customer.app"
}
signingConfigs {
release {
}
}
compileSdkVersion 25
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
}
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
api 'com.google.android.gms:play-services-maps:+'
api 'com.google.android.gms:play-services-location:+'
api 'com.android.support:appcompat-v7:+'
api 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
...
My
W:\android-studio-projects\sharedid\build.gradle
Looks like this
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
...
I am but lost on solving the Android Issues... Seems not to originate from my code but appcompat. Anyhow way to flush/fix this?
...
UPDATE 23rd April: I have made the following fixes
In W:\android-studio-projects\sharedid\build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:+'
}
In W:\android-studio-projects\sharedid\app\build.gradle
defaultConfig {
applicationId "com.example.company.app"
minSdkVersion 14
compileSdkVersion 25
}
This resulted in a new set of errors - but I feel it is progress:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:processDebugResources'. 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:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource
linking failed Output:
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3:
warn: generated id 'android:id/background' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5:
warn: generated id 'android:id/progress' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4:
warn: generated id 'android:id/secondaryProgress' for external package
'android'.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7:
error: resource android:attr/colorError not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11:
error: resource android:attr/colorError not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15:
error: style attribute 'android:attr/keyboardNavigationCluster' not
found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7:
error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11:
error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontStyle not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/font not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontWeight not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontVariationSettings not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/ttcIndex not found. error: failed linking
references.
Command:
C:\Users\%Username%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe
link -I\
D:\Java-Android-SDK\platforms\android-25\android.jar\
--manifest\
W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.company.app\
-0\
apk\
--output-text-symbols\
W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 Output:
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3:
AAPT: warn: generated id 'android:id/background' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5:
AAPT: warn: generated id 'android:id/progress' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4:
AAPT: warn: generated id 'android:id/secondaryProgress' for external
package 'android'.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:9:5-12:13:
AAPT: error: resource android:attr/colorError not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:13:5-16:13:
AAPT: error: resource android:attr/colorError not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:17:5-93:
AAPT: error: style attribute 'android:attr/keyboardNavigationCluster'
not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v28\values-v28.xml:9:5-12:13:
AAPT: error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11:
AAPT: error: resource android:attr/dialogCornerRadius not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84:
AAPT: error: resource android:attr/fontStyle not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84:
AAPT: error: resource android:attr/font not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84:
AAPT: error: resource android:attr/fontWeight not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84:
AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84:
AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references. Command: C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe
link -I\
D:\Java-Android-SDK\platforms\android-25\android.jar\
--manifest\
W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.company.app\
-0\
apk\
--output-text-symbols\
W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 at
com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteException(Aapt2ErrorUtils.kt:97)
at
com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteLinkException(Aapt2ErrorUtils.kt:73)
at
com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:519)
at
com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTaskAction(LinkApplicationAndroidResourcesTask.java:269)
at
com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
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:73) at
org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at
org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at
org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 33 more Caused by:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource
linking failed Output:
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3:
warn: generated id 'android:id/background' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5:
warn: generated id 'android:id/progress' for external package
'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4:
warn: generated id 'android:id/secondaryProgress' for external package
'android'.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7:
error: resource android:attr/colorError not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11:
error: resource android:attr/colorError not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15:
error: style attribute 'android:attr/keyboardNavigationCluster' not
found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7:
error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11:
error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontStyle not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/font not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontWeight not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/fontVariationSettings not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235:
error: resource android:attr/ttcIndex not found. error: failed linking
references.
Command:
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe
link -I\
D:\Java-Android-SDK\platforms\android-25\android.jar\
--manifest\
W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.company.app\
-0\
apk\
--output-text-symbols\
W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 at
com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:177)
at
com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:103)
at
com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:176)
at
com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:811)
at
com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:517)
... 50 more
W:\android-studio-projects\sharedid\app\src\main\AndroidManifest.xml
---> You don't need add
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="25"
/>
W:\android-studio-projects\sharedid\app\build.gradle
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.customer.app"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
}
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.github.PhilJay:MPAndroidChart:v2.0.8'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
W:\android-studio-projects\sharedid\build.gradle
buildscript {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You can try it.
In build.graddle(app)
try changing dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
GoTO File>Project Structure(ctrl+ALT+Shift+S)
Click second button(Project) and change grade version to 4.4
Remove the gradle from the project and let android studio make one
You can solve the issue by updating the compileSdk version and build gradle of the app.
First update the build tool version of the app to 3.1.1
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
Second change the compileSdkVersion version of the app.Two ways to update compileSdkVersion is:
1.Specify the buildToolVersion
defaultConfig {
applicationId "com.robosoft.sampleproject"
minSdkVersion 14
compileSdkVersion 25
buildToolsVersion '26.0.2'
}
2.If you dont specify build tool version increase the compilSdkVersion to 26 for gradle 3.1.1
defaultConfig {
applicationId "com.robosoft.sampleproject"
minSdkVersion 14
compileSdkVersion 25
}
When you update Android Studio, it always ask to update your gradle version.
If you allow to update the gradle version, Your whole build files need to update like Api's and target version Which is difficult to track.
What you can do is first re import as new project and don't allow upgrade the gradle version and try to compile then if it is compiled successfully then update your gradle version related to new Android Studio.
Although this already has an answer, this didn't work for me. For lot's of developers who might still facing this issue and are unable fix by any of the above mentioned work around. Please see, what worked for me.
I noticed that in gradle.properties file there are 2 new lines,
android.useAndroidX=true
android.enableJetifier=true
Commenting these 2 in the gradle.properties made all my issues go away, and a successful build.
I hope this helps to some of the developers finding the resolution.

Android build error DexIndexOverflowException

I am not able to build my Android app. I keep seeing this error:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
However, it doesn't tell me which gradle dependencies are causing my build to fail. How do I go about troubleshooting this?
Igor
It seems the only way to solve my dilemma was to enable multidex in my project:
In AndroidManifest.xml:
<application
android:name="android.support.multidex.MultiDexApplication"
In app's build.gradle:
dependencies {
compile 'com.android.support:multidex:1.0.0'
and
defaultConfig {
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
multiDexEnabled true

Resources