I just updated sdk and android studio i have this problem:
Error:Execution failed for task ':library:proguardRelease'.
> java.lang.NullPointerException (no error message)
How can i solve this?
Can i go home?
First, try to use clean.
Second, if that doesn't help, get more info about the failure. You can use the following parameters for your build command:
-i will print the logs with INFO level
-d will print the logs with DEBUG level
-s will print the exception stack trace
e.g., running ./gradlew assemble -d -s should give you a lot of information that can help locate the issue.
Related
After I clone from gitlab a react-native project
npm install
react-native run-android
add --stacktrace
But I do have build tool 23.0.1. How can I fix it?
ADB configuration may be missing
MyComputer-Properties-Advances System Settings-System Properties-Environment Variable - User variable
here add path to tool inside android SDK
pathto SDK/platform-tools
In the screenshot when you ran with --stacktrace you can actually see the error:
Cannot run program: "/home/ljh/work/software/Sdk/build-tools/23.0.1/aapt"
and then the error in Chinese saying:
"No file or directory"
Make sure the file /home/ljh/work/software/Sdk/build-tools/23.0.1/aapt actually exists, or if it does, try to execute it by hand form that directory ("$ aapt package -h") to see if an anti-virus isn't blocking it.
Error:Execution failed for task 'app:generateDebugBuildConfig'
java.io.FileNotFoundException: C:\Users\bok\Desktop\Zipzap\app\build\generated\source\buildConfig\debug\com\storie\myapp \BuildConfig.java (Le chemin d’accès spécifié est introuvable)
What's the solution ..
I hope to find a solution to this problem
Try to clean project this is working for me
for android
$ cd android
$ ./gradlew clean
BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed
Changing port worked for me
You Could try:
react-native run-android --port=8082
Try to clean and rebuild project or you can try to remove whole build folder and build after removing. If it won't help, show your build.gradle, your current information isn't enough to recognise the reason of problem.
React Native
Faced similar issue while building react native app. Running on the different port as the default port (8081) is used by some other app.
Command to build the app.
react-native run-android --port=8082
Solution
Removed extra attribute android:screenOrientation="portrait". If you check the log, it says
lineNumber: 26; columnNumber: 56; Attribute "screenOrientation" bound
to namespace "http://schemas.android.com/apk/res/android" was already
specified for element "activity".
hence removed the same attribute. This was being added multiple times
Error log
Configure project :react-native-webview
:react-native-webview:reactNativeAndroidRoot /Users/PROJECT_PATH/node_modules/react-native/android
Task :app:generateDebugBuildConfig FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:generateDebugBuildConfig'.
org.xml.sax.SAXParseException; systemId: file:/Users/PROJECT_PATH/android/app/src/main/AndroidManifest.xml; lineNumber: 26; columnNumber: 56; Attribute "screenOrientation" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "activity".
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
32 actionable tasks: 1 executed, 31 up-to-date
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/getting-started.html
Command failed: ./gradlew installDebug
Go to project root.
Go to android folder.
cd android
Clean gradle.
.\gradlew clean
(./gradlew clean didnot work for me for some reason.)
Go back to root.
cd ..
Run react native.
npx react-native run-android
In android studio,
On the Menu Bar, go to build
Click clean project and wait for project to clean
Then on the menu bar again, go to build -> rebuild project and wait for project to rebuild.
That's all
I recently wanted to try out ionic and specifically develop android apps. I was able to set everything up using the ionic tutorial and run via localhost. I want to be able to do the same using the android emulator but have been unsuccessful. I have searched and tried everything but I am still not sure how to resolve the error below. All the code is from the ionic getting started page with their project called todo. If anyone could help me with this. it would be much appreciated. I am using Ubuntu. The following is what my terminal gives when I run "ionic build android"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:
Process 'command '/home/myname/Android/Sdk/build-tools/24.0.0/aapt''
finished with non-zero exit value 127
* 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: 37.93 secs
Error: Error code 1 for command: /home/myname/todo/platforms/android
/gradlew with args: cdvBuildDebug,-b,/home/myname/todo/platforms
/android/build.gradle,-Dorg.gradle.daemon=true,
Pandroid.useDeprecatedNdk=true
Edit 1:
I ran the following command suggested below: ./gradlew assembleDebug -info and I get the following error:
:CordovaLib:processDebugResources
Executing task ':CordovaLib:processDebugResources' (up-to-datecheck
took 0.058 secs) due to:
No history is available.
All input files are considered out-of-date for incremental task
':CordovaLib:processDebugResources'.
Starting process 'command '/home/myname/Android/Sdk/build-tools/24.0.0
/aapt''. Working directory: /home/myname/todo/platforms/android
/CordovaLib Command: /home/myname/Android/Sdk/build-tools/24.0.0/aapt
package -f --no-crunch -I /home/myname/Android/Sdk/platforms/android-
23/android.jar -M /home/myname/todo/platforms/android/CordovaLib/build
/intermediates/bundles/debug/aapt/AndroidManifest.xml -S /home/myname
/todo/platforms/android/CordovaLib/build/intermediates/bundles/debug/res
-A /home/myname/todo/platforms/android/CordovaLib/build/intermediates
/bundles/debug/assets -m -J /home/myname/todo/platforms/android
/CordovaLib /build/generated/source/r/debug --debug-mode --custom-
package
org.apache.cordova --non-constant-id -0 apk --output-text-symbols
/home/myname/todo/platforms/android/CordovaLib/build/intermediates
/bundles /debug
Successfully started process 'command '/home/myname/Android/Sdk/build-
tools/24.0.0/aapt''
Unknown source file : /home/myname/Android/Sdk/build-tools/24.0.0/aapt:
1: /home/myname/Android/Sdk/build-tools/24.0.0/aapt: ELF: not
found :CordovaLib:processDebugResources FAILED
From what I see I understand that something is wrong with the aapt file, If I remove it it throws errors, so I am not sure how to edit the aapt file
This could be related to a filename error somewhere in your project.
To see where the error in file is,
go to your android folder via terminal,
/projectName/platforms/android
Then, execute gradlew assembleDebug --info
It should show in the end which file it is.
-- EDIT
This could be related to Ubuntu incompatibility problems,
As per https://stackoverflow.com/a/27734148/2036808
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
After hours spent in the same issue, just solved the problem by running some updates:
npm update -g ionic cordova
This information was found at: https://forum.ionicframework.com/t/android-build-failed/32069
Status: Didn't found a solution. I am editing my steps what i try at the end of question.
This is working (Creating example app, and running on android):
meteor create meteor-example
.. blah blah ..
meteor run android
But my main project isn't working. Here is the verbose code
:processDebugManifest
FAILEDting app on Android Emulator \
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/sea/Android/Sdk/build-tools/24.0.0/aapt'' 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: 5.557 secs
Error code 1 for command: /home/sea/allinone/.meteor/local/cordova-build/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/sea/allinone/.meteor/local/cordova-build/platforms/android/build.gradle,-PcdvBuildArch=x86,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true undefined
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --emulator:
Error: Command failed:
/home/sea/allinone/.meteor/local/cordova-build/platforms/android/cordova/run
--emulator
at ChildProcess.exitCallback (/tools/utils/processes.js:151:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
/home/sea/.meteor/packages/meteor-tool/.1.3.3_1.qc654++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/isopackets/cordova-support/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:165
throw error;
^
ExitWithCode:1
I see the error at first line, now.
:processDebugManifest
FAILEDting app on Android Emulator \
Should i create a mobileconfig.js for it? I don't know how to use mobileconfig, but if necessary i'll search for it.
My Debugging Survey:
1) Fail message was: :processDebugManifestFAILEDting app on Android Emulator. I think i should edit my cordova's androidManifest in .meteor/local/cordova-build/platforms/android. To inspect what is wrong, opened two manifest file (ExampleApp's manifest,MainApp's manifest). Everything looks same. Changed uses-sdk minSdkVersion 14 to 21, computer frozen, usb mouse working with delay. Restarted the computer. Trying again with meteor run android-device --verbose
Final: Throwed same error.
I think its related with androidManifest file.
I cannot run any project. I created a default project with an acitivity and when i try to run it I get this error.
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\androidstudio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4 --output C:\projects\app\build\intermediates\dex\debug C:\projects\app\build\intermediates\classes\debug C:\projects\app\build\intermediates\dependency-cache\debug
Error Code:
1
Output:
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
any dependency it tries to copy to dex/debug im guessing, but fails to do so.
Any ideas?
First of all, you should double check that the path C:\androidstudio\sdk\build-tools\android-4.4W\dx.bat does indeed exist. It could be that your SDK configuration is pointing at an invalid directory (though that's unlikely, given how far you're getting in the compilation/build process).
After that, this looks very similar to a similar error on OSX, so you might try the proposed solution there, which is to run gradlew.bat --stop using the Gradle wrapper script that should be in the root of your project and then try to compile again.