I'm trying to share imagens from my react native app which is running at v 0.61.5 to instagram stories. To do so I'm using react-native-story-share library at version ^0.4.0.
I have done the whole implementation of the library, which is showing me some erros. I thought at first that the errors where related to the implementation of the lib it self, but when I delete the implementations and execute react-native run-android it shows following error:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.snapchat.kit.sdk:creative:1.1.4.
If I dont delete the implementation process, following error appears:
Execution failed for task ':app:generateDebugBuildConfig'.
> org.xml.sax.SAXParseException; systemId: file:/C:/Users/.../android/app/src/main/AndroidManifest.xml; lineNumber: 17; columnNumber: 11; O atributo "name" vinculado ao namespace "http://schemas.android.com/apk/res/android" j� foi especificado para o elemento "meta-data".
That may occur because I already use metadata name for facebook, when not using the suggested metadata from the lib, following error occurs:
What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.snapchat.kit.sdk:creative:1.1.4]
Im dealing with these 3 erros but im clueless when dealing with it. I tried opening snapchat documentation, but couldnt find anything there related to this problem aswell. There is also nothing related to this kind of problem at the documentation of the lib
Related
I am trying to work with Jenkins however I cannot build the apk with it as I am having issue with AAPT2 and Gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-hdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-xhdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-mdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
I already read tons of SO question that may share same issue to my case saying that it has something to do with the file path being too long but I still cannot find any solution.
UPDATE
I tried to change Android Studio Gradle home similar to what Jenkins is using and received similar error which indicates that it may really have something to do with long file path.
I think the final question will be how to change Jenkins Gradle Home?
You need to replace \ with \\ if you are giving path with jenkins in Windows.
May be if file path is too huge or that is the root cause you can try mounting the directory to a short path
EDIT : Based on your modified question :
Open Jenkins dashboard. Navigate to Manage Jenkins-> Configure System. Under the Global properties section add another environment variable named GRADLE_USER_HOME as shown below.
I ran into this exact issue, but unfortunately changing the GRADLE_USER_HOME environment variable did not help, as aapt2 appeared to ignore the change and still used Windows/system32/... for the cache location.
The problem was how I was running Jenkins as a service. In the service.msc settings, it was set to Log On as a Local System account, which set the USER_HOME variables to C:\Windows\System32. Because of this, the reason the error said that the file did not exist was because Jenkins/gradle did not have access to the System32 folder.
My fix was to change the log on method to 'This account', then enter a user account so Jenkins wasn't logged on as system anymore.
I have been running this react-native project on my android device and it has been working without any problems till yesterday.
Today when I run react-native run-android I am getting this following error:
> Task :app:preDebugBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.facebook.react:react-native:0.20.+.
Required by:
project :app > project :react-native-charts-wrapper
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from http://repo.spring.io/libs-release/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'http://repo.spring.io/libs-release/com/facebook/react/react-native/maven-metadata.xml'. Received status code 403 from server: Forbidden
> Could not resolve com.facebook.react:react-native:0.12.+.
Required by:
project :app > project :react-native-i18n
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from http://repo.spring.io/libs-release/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'http://repo.spring.io/libs-release/com/facebook/react/react-native/maven-metadata.xml'. Received status code 403 from server: Forbidden
Since it is a 403 I tried using a different Internet Connection and even a VPN , but it still is giving me the same error. Even my colleague is getting the same error.
This is the dependency on my build.gradle file : implementation "com.facebook.react:react-native:+"
Are other people also facing this issue?
Wonder why this is happening and how can I solve this?Thanks!
Got it to work by changing http to https at:
maven {
url "https://repo.spring.io/libs-release/"
name 'Spring Libs'
}
Weird though since it had no issue till a day ago. Lol
I got an old running project that when built shows dependency error.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-mqtt-iot'.
Could not resolve all dependencies for configuration ':react-native-mqtt-iot:_debugPublishCopy'.
Could not resolve co.ibhubs.ibchat:ibchat:0.0.1.
Required by:
project :react-native-mqtt-iot
Could not resolve co.ibhubs.ibchat:ibchat:0.0.1.
Could not get resource 'https://api.bitbucket.org/1.0/repositories/mumsnbabies/maven_awsiot/raw/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom'.
Could not GET 'https://api.bitbucket.org/1.0/repositories/mumsnbabies/maven_awsiot/raw/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom'. Received status code 410 from server: Gone
Could not resolve co.ibhubs.ibchat:ibchat:0.0.1.
Could not get resource 'https://api.bitbucket.org/1.0/repositories/mumsnbabies/maven_ibchat/raw/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom'.
Could not GET 'https://api.bitbucket.org/1.0/repositories/mumsnbabies/maven_ibchat/raw/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom'. Received status code 410 from server: Gone
Is it because of change of api version from 1.0 to 2.0? If so how to fix it?
Okay so I got the solution to fix.
In my case i change the url from https://api.bitbucket.org/1.0/repositories/mumsnbabies/maven_awsiot/raw/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom
to
https://api.bitbucket.org/2.0/repositories/mumsnbabies/maven_awsiot/src/releases/co/ibhubs/ibchat/ibchat/0.0.1/ibchat-0.0.1.pom
And adding the following lines of code before the url:
authentication {
basic(BasicAuthentication)
}
The Problem:
when i am trying to build release variant of my Kotlin project in Android Studio 3.3 Beta 2, it is getting stuck randomly for 10 to 16 minutes after spitting some errors.
Running gradle/assemble it showed following errors :
> Task :app:lintVitalRelease FAILED
:app:lintVitalRelease (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 8 mins 23.222 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
> Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
> Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
> Connection reset
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:lintVitalRelease'.
What I've tried so far
Answer from this question Could not find org.codehaus.groovy:groovy-all:2.4.12
but it isn't downloading at all and getting stuck.
tried to open the link in the browser and it is downloading the file but it is not downloading while in the build process https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar
created a brand new project tried to release it same problem there
Project Gradle settings
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0"
classpath 'com.android.tools.build:gradle:3.4.0-alpha02'
//workaround for Dagger2 > 2.16
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
i don't know what is causing it to stop downloading or not allowing it to download the groovy file but i am stuck here and can't release my app :(
when i updated my Android Studio to ver3.3 today ,i met this problem ,and here are my errors:
"Execution failed for task ':app:lintVitalRelease"....
"org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath"
.....
"Could not download junit.jar (junit:junit:4.12)"
.....
"org.gradle.api.resources.ResourceException: Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'."
.....
"org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'"
.....
this time its 'junit.jar',and 30mins ago its 'groovy-all.jar'....ithink there are sth wrong with my internet,so i have tried many times and waited for hours...
but when i searched 'Execution failed for task ':app:lintVitalRelease' when i was waiting ,i found another solution,add the following lines to android{} in app\build.gradle
"lintOptions {
checkReleaseBuilds false
abortOnError false
}"
i dont know why,but it works,the red lines disappear...
I solved it by waiting for 30 minutes so it can download the groovy jar file, before trying it for 2 hours and it was no problem with my internet.
thanks #TheWanderer to hint me about the internet
Accepted answer is right, just one more thing. For me I was using VPN as I was connected to database via secure channel. Hence, when I was running android studio, it was failing at similar point. Once I turned off my vpn and ran again it worked like a charm...
I run my android project, everything is correct and an error comes to say execution failed for task as shown on details.
Details :
Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exception while doing past iteration backup : Source C:\Users\Abdulwahid\AndroidStudioProjects\More1Activity\app\build\intermediates\builds\debug\13727462725703\classes.dex and destination C:\Users\Abdulwahid\AndroidStudioProjects\More1Activity\app\build\intermediates\builds\debug\13727462725703\classes.dex must be different
It just need to rebuild the project.