android.permission.ASEC_CREATE error when trying to run react app - android

I try to run "react-native android" but got the following errors
Execution failed for task ':app:installDebug'.
com.android.builder.testing.api.DeviceException:
com.android.ddmlib.InstallException: Failed to finalize session :
Unknown failure (Error: java.lang.SecurityException: Requires
android.permission.ASEC_CREATE permission)
I have no problem running on emulator, but if i try to run on my phone, the error occurs
I try google but have zero results. Any ideas?

This problem appeared to me when I upgraded Android Studio and then Gradle.
To solve the problem I returned the version of Gradle:
Buildscript {
Repositories {
Jcenter ()
}
Dependencies {
classpath 'com.android.tools.build:gradle:2.x.x'
...
}
}

As of I face this issue, had searched a lot for the solution.
Later on came to know maybe this issue occurs due to multiDexEnabled true in your
app/build.gradle in defaultConfig{}
after Successful Sync of Project what you have to do is :
list out your devices >> adb devices
You can see your listed deviceId like 1234553231221
run your project >> react-native run-android --deviceId your_device_id

My problem solved after change preferred install Location sdcard to phone Storage in mobile setting. hope this help you

Related

SPLUNK MINT throwing ssl error in Android studio

when I run my program its throwing "ssl error" and "remote host terminated the handshake".
Currently I am using the below library in build.gradle. I have tried upgrading to 5.2.5 but in its website it shows they have stopped the service. Even tried other methods but nothing worked. How can I solve this?
repositories
{
url "https://mint.splunk.com/gradle/"
}
dependency
{
implementation 'com.splunk.mint:mint:4.4.0'
}
1)Tried adding
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
removed .gradle and .idea and ran the code
changed the sdk
accept non-trusted certificates automatically
added
systemProp.http.proxyHost=x
systemProp.https.proxyPort=y
systemProp.https.proxyHost=x
systemProp.http.proxyPort=y
but this throws error as x is not recognised

Android simulator can't start the app during running test with Detox

I want to test our app with detox. On IOS it works fine, but it doesn't work yet on Android.
So when I run the detox test the simulator will open, but the app won't be started. In the logs is stated that the build was successful. Besides that when the test have failed, I can open the app on the simulator and everything works. (The tests are not ready started yet, they are in the setup fase when the issue happens)
This is the error message I get:
DetoxRuntimeError: Failed to run application on the device
HINT: Most likely, your tests have timed out and called
detox.cleanup() while it was waiting for "ready" message (over
WebSocket) from the instrumentation process.
at EmulatorDriver._getInstrumentationCrashError (/Users/corinejanssen/PycharmProjects/de-selfcare/frontend/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:175:12)
at EmulatorDriver.instrumentationCloseListener (/Users/corinejanssen/PycharmProjects/de-selfcare/frontend/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:142:67)
at EmulatorDriver._terminateInstrumentation (/Users/corinejanssen/PycharmProjects/de-selfcare/frontend/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:166:12)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async ChildProcess. (/Users/corinejanssen/PycharmProjects/de-selfcare/frontend/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:266:7)
{ name: 'DetoxRuntimeError' }
Versions I use:
Detox: 16.2.0
jest: 25.0.1
node: 12.16.0
Is someone who has this issue and solved it?
I solved this issue, by trying a lot of things. I think it was related to a missing dependency in the android/build.gradle.
For the exactness I put all the dependencies we add to this file:
dependencies {
classpath "com.android.tools.build:gradle:3.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}

Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15) in Android Studio 3.3 Beta 2

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...

TeamCity, Android, Gradle Script failure

I have been struggling to get TeamCity to build my Android Project. I have finally gotten the server to be able to compile the project with Gradlew (although I have to ignore lint errors, which I am not happy about - it will not tell me which lint errors are being violated EDIT: I found it in ..\build\outputs\lint-results.html)
But now I can see that it is trying to execute the following:
C:\TeamCity\buildAgent\work\284714bad9f1a533\MyProject>gradlew.bat --init-script C:\TeamCity\buildAgent\plugins\gradle-runner\scripts\init.gradle clean build
And I am getting the following error:
FAILURE: Build failed with an exception.
* Where:
Initialization script 'C:\TeamCity\buildAgent\plugins\gradlerunner\scripts\init.gradle' line: 31
* What went wrong:
A problem occurred evaluating initialization script.
> Cannot invoke method split() on null object
I have checked this line and it seems fairly standard:
initscript {
dependencies {
def teamCityInitLib = System.getenv("TEAMCITY_BUILD_INIT_PATH")
println "Init lib: ${teamCityInitLib}"
def classPathFiles = teamCityInitLib.split(File.pathSeparator) //line 31
classpath files(classPathFiles)
}
}
Can anyone help me? NOTE: the following command works without a problem:
gradlew.bat clean build
Seems that you don't have TEAMCITY_BUILD_INIT_PATH variable in your PATH on your build machine. You can add it either by standart ways, depending on OS, or by adding it to Build Parameters in Configuration Steps of your build.
It seems like the build file is not being found. At least, that is what support is telling me. To me this is a TeamCity bug and not on my side. When I find out more, I'll post it.
Found this post while looking for a way to emulate a TC build from the command line and trying to understand how to set TEAMCITY_BUILD_INIT_PATH.
In my environment I determined that it's set to:
/apps/teamcity-agent/agent/lib/serviceMessages.jar:/apps/teamcity-agent/agent/lib/runtime-util.jar:/apps/teamcity-agent/agent/plugins/gradle-runner/lib/gradle-runner-common.jar
Where /apps/teamcity-agent is the my TC install path.
Hope this helps.

Gradle in Android Studio 0.44 can't find process on path to run in an Exec Type task

I used to have the following gradle build task:
task buildWebApp(type: Exec) {
executable = Os.isFamily(Os.FAMILY_WINDOWS) ? "grunt.cmd" : "grunt"
args = ["build"]
}
This would pick the appropriate grunt command and run it with the argument "build".
This worked without any kind of issue
I've just tried this in Android Studio 0.4, using Gradle 1.9 and it's no longer working. Instead I get the following error:
Execution failed for task ':BrowserPages:buildWebApp'.
A problem occurred starting process 'command 'grunt''
Normally at this point I would debug with gradlew, but running the following command, throws no errors:
$ ./gradlew buildWebApp
I've also tried running the full task list to still not find any problems.
The way this is executed is from my main build.gradle file with this dependency
copyWebApplication.dependsOn ':BrowserPages:buildWebApp'
Anyone have any ideas?
I've tried to run executable = "node" with arg = ["-v"] and get the same error where it can't find node. Node is globally accessible on my terminal, so I can only assume that the command is being run in a different environment to the terminal. There is the option for setting the environment but I can't find any examples of how it should be used.
Try using a fully-qualified path to the grunt executable. Perhaps something in the path has changed between Android Studio/Gradle/Android Plugin versions.

Categories

Resources