react-native-vector-icons:processReleaseResources - android

I am attempting to install the sample app here: https://github.com/brentvatne/react-native-scrollable-tab-view
After install, I attempt to run, but the error appears:
:react-native-vector-icons:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-vector-icons:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.E
xecException: Process 'command 'C:\Users\KJA\AppData\Local\Android\sdk\build-too
ls\23.0.1\aapt.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 23.638 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
How can this be alleviated?

ref: https://github.com/oblador/react-native-vector-icons/issues/102
I spent a whole lot of time trying to figure out this error, and (at least for me) it turns out to be something really stupid, and largely unrelated to the react-native-vector-icon library.
After many hours of A-B-A testing, I have come to the conclusion that this library has some very long path names in it.
This really adversely affects Windows users.
If I have my project located at: C:\Users\MyName789\Dropbox\123 Software Development -- React Native\IconExplorer we get a total fail.
If I move the project to: C:\IconExplorer everything works well.
Recommendation for Windows users: There are many files affected while running react-native run-android. Long file name addresses will result in numerous errors, including Execution failed for task ':react-native-vector-icons:processReleaseResources' With that said, keep your file path names as short as possible!

On Windows one could fire up regedit, then search for
LongPathsEnabled
and set it to 1.
Do a reboot afterwards and if the problem lies only within long path names, it should be gone.

Related

Android Detekt Build failed

I tried to generate code report using detekt and when execute the below command in terminal
gradle detekt
it showing build failed with below message.
* What went wrong:
Execution failed for task ':app:detekt'.
> Build failed with 395 weighted issues.
As others have said in the comments, this means you have 395 issues in your code (kind of like lint warnings).
Detekt has a maxissues: property that determines whether or not to fail the build if your issues surpass the allowed number of maxissues. What I did was search the whole project for maxissues, which will take you to your detekt-config.yml or default-detekt-config.yml. There, you can change your maxissues to whatever you want.
In our old code base, we had 900 some issues, so I changed mine from maxissues:0 to masissues:1000. As we clean up the code, I hope to bring that number down.

Couldnot update time stamp Error when running 'react-native run-android' in gc.properties ( react-native )

When I am running react-native run-android it says :
FAILURE: Build failed with an exception.
* What went wrong:
Could not update time stamp for /home/userName/Desktop/hello-world/android/.gradle/4.10.2/gc.properties
Upon running --stacktrace, it shows :
* Exception is:
org.gradle.api.UncheckedIOException: Could not update time stamp for /home/userName/Desktop/hello-world/android/.gradle/4.10.2/gc.properties.
What can be the possible reason of this? I searched it a lot but failed to find a solution.
Solved. I deleted gc.properties and then gave all permissions to my react-native project. Main problem was related to permissions.

Android Espresso shards randomly fail with INSTALL_FAILED_INVALID_APK

EDIT: Below is the original post. It was the initial issue I had ran into, but repeating my steps over and over I am getting different results. The first time I tried to run my shards after posting this, I got:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ProgressiveApp:packageInternalStaging'.
> invalid distance too far back
The next time:
> invalid code lengths set
And the next:
> Unexpected end of ZLIB input stream
All three appear to be zip/compression related issues. Perhaps this is my primary issue.
Original post below:
I'm using AndroidX Espresso 3.1.0 along with ANDROIDX_TEST_ORCHESTRATOR. The only issue I have is that when I run shards (to speed up test runs), it sometimes decides to fail for no good reason.
For example, I open three terminals and three emulators. I run one of these in each terminal to kick off three separate shards:
ANDROID_SERIAL=emulator-5554 ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.numShards=3 -Pandroid.testInstrumentationRunnerArguments.shardIndex=0
ANDROID_SERIAL=emulator-5556 ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.numShards=3 -Pandroid.testInstrumentationRunnerArguments.shardIndex=1
ANDROID_SERIAL=emulator-5558 ./gradlew connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.numShards=3 -Pandroid.testInstrumentationRunnerArguments.shardIndex=2
This then runs a third of my tests on each emulator. So good so far. After a long time, they're all done and I have a nice HTML report telling me zero tests failed. I haven't touched my code, I haven't touched the emulators. I go to touch each of the terminals. In each I hit the up arrow to grab the last command ran in that terminal, and then enter to rerun exactly what I just ran. Two of the emulators are fine and run through all their tests. The third does not, and gives me this error message below:
> Task :<snip>:connectedInternalStagingAndroidTest FAILED
[no message defined]
java.lang.RuntimeException: com.android.builder.testing.api.DeviceException:
com.android.ddmlib.InstallException: INSTALL_FAILED_INVALID_APK
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_INVALID_APK
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:132)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:147)
at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:59)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 4 more
Caused by: com.android.ddmlib.InstallException: INSTALL_FAILED_INVALID_APK
at com.android.ddmlib.Device.installRemotePackage(Device.java:1031)
at com.android.ddmlib.Device.installPackage(Device.java:902)
at com.android.ddmlib.Device.installPackage(Device.java:880)
at com.android.ddmlib.Device.installPackage(Device.java:869)
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:126)
... 7 more
Why? How? It doesn't make any sense. I hit up and enter again and then it happily runs through all the tests without issue.
My problem is that this random failure happens enough I can't set up my machines to use sharding, and therefore cannot speed up the test running process for my team.

Jenkins failing robolectric test cases...!

I am trying to build my android project on Jenkins 2.0 server on Ubuntu machine.
I am running the following commands for that purpose:-
./gradlew clean (this is working fine)
./gradlew build (this is failing random number of test cases)
However I also install Jenkins 2.0 on my Windows 7 machine and run the same commands as above, and it was passing all test cases every time. I am not understanding what is wrong with that.
I did lot of debugging but could not find any solution, please help me to get rid out of this thing...!
This is my 34th build log on Jenkins
testPreCondition FAILED
java.lang.NullPointerException at ConfigurationFragmentTest.java:36
handleBackButtonPressing FAILED
java.lang.NullPointerException at ConfigurationFragmentTest.java:36
48 tests completed, 2 failed
:app:testDebugUnitTest FAILED
This is my 35th build log on Jenkins without making any code changes
> handleBackButtonPressing FAILED
java.lang.NullPointerException at ConfigurationFragmentTest.java:36
> testPreCondition FAILED
java.lang.NullPointerException at ConfigurationFragmentTest.java:36
> testPreconditions FAILED
java.lang.NullPointerException at UpdateTabFragmentTest.java:30
> testPreconditions FAILED
java.lang.NullPointerException at ServiceTabFragmentTest.java:29
> testPreConditionIsNotNull FAILED
java.lang.NullPointerException at HomeActivityTest.java:63
48 tests completed, 5 failed
:app:testDebugUnitTest FAILED
You should check the Jenkins console output for something like
"WARNING: No manifest file found " in the console output.
Those NPEs are typical for missing resources.
The most common source for failing robolectric builds on different environmnets is probably robolectric not beeing able to load any resources.
Since robolectric needs to know where your Android Manifest is, you may have to provide a extra robolectric.properties for the build
http://robolectric.org/configuring/

Android Studio Palette is disabled

I haven't see since when, but my palette doesn't show up, I did some search about it, they say: "Restart the project", but I don't know why when I go in View >> Tool Windows, palette is disabled:
I did a update too, to see if it appeared but it didn't.
Logcat say:
0 warnings.
0 errors.
Console:
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
AGPBI: {"kind":"ERROR","text":"Resource id cannot be an empty string (at \u0027id\u0027 with value \u0027#+id/\u0027).","sourcePath":"C:\\Users\\...\\AndroidStudioProjects\\Solutis\\app\\src\\main\\res\\layout\\activity_contact.xml","position":{"startLine":7,"startColumn":17,"startOffset":308,"endColumn":22,"endOffset":313},"original":""}
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\...\AppData\Local\Android\Sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I found a lot of post with this problem, and i found why, the palette is not disabled, it's activated but it's hidden here:
So you juste have to stretch it
You can restore your layout to default by navigating to Window/Restore Default Layout:
I came up with the same problem. And after going through a lot of trouble, I could fix it with Window -> Restore Default Layout (Shift+F12). It made the palette and the component tree visible again.

Categories

Resources