I'm trying my hand at creating a push notification app in ionic. I've been followinthisg tutorial.
When I do a
ionic cordova run android
I receive an error message :
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
No matching client found for package name 'io.ionic.starter'
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
Task :app:writeDebugApplicationId UP-TO-DATE
Task :app:processDebugGoogleServices FAILED
Parsing json file: C:\Users\xxx\source\repos\ionic4-push\platforms\android\app\google-services.json
26 actionable tasks: 1 executed, 25 up-to-date
Everything points to the google-services.json file not being there, or being corrupted. The file is indeed at that location, and I've redownloaded the file and replaced it.
I've gone one step further, and attempted to run the command (what I assume) ionic is running, in cmd :
"C:\Program Files\Java\jdk1.8.0_241/bin/java.exe" "-Xmx64m" "-Dorg.gradle.appname=gradlew" -classpath "C:\Users\xxx\source\repos\ionic4-push\platforms\android\gradle\wrapper\gradle-wrapper.jar" org.gradle.wrapper.GradleWrapperMain "cdvBuildDebug" "-b" "C:\Users\xxx\source\repos\ionic4-push\platforms\android\build.gradle"
Can anyone point me in the direction of the cause of this problem?
Have you added app to firebase with io.ionic.starter this package name? and check your google-services.json file, it should contain information related to your package name. This kind of error occurs when your google-services.json file not contain your app information.
Hope it will helps!!
Related
I am trying to understand gradle.
I followed the gradle tutorial here: https://docs.gradle.org/current/samples/sample_building_java_applications.html#what_youll_build
In short:
I created a folder: mkdir demo
cd demo
gradle init (so far so good)
Now, I tried to run my application like this: gradlew run.
The first run of the application was successful. However, the subsequent runs kept failing and I got a very non descript error.
> Task :app:run FAILED
Error: Could not find or load main class demo.App
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:run'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_211\bin\java.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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 1 executed, 1 up-to-date
Then, I deleted the files inside "Z:\Projects\demo\ .gradle\6.7.1\executionHistory" and I was able to run the application again.
This was happening again and again. Please see attached screenshot:
What am I doing wrong -- how do I fix this so that all calls to 'gradlew run' give me a successful build?
Edit:
I tried it on C: and was able to do 'gradlew run' consistently and get
the 'Hello World' output without any issues. My Z drive is actually an
encrypted VeraCrypt file which has been loaded with letter 'Z'. Not
sure if that is causing problems.
Thanks!
Hello I was facing the issue too, spend a lot of time and now I am sure, that the issue is the file system. I believe that your encrypted partition is using exFAT. Gradle is not able to process this file system properly.
Could Someone help me this problem?
I got this error when I use Ionic & cordova, trying to build the andorid app.
I have tried few way to solve this problem, like:
reinstall the Java JDK 8
edit the computer env variable path (JAVA_HOME, PATH...etc)
But none of these work :(
I current use:
Ionic#1.2.4
cordova#8.0.0
Windows 10
Node.js#11.6.0
npm#6.5.0-next.0
jdk 1.8.0_271
Windows PowerShell Photo
⚡ lienlab#CCU_LAB ~ Desktop client HybridApp_Zyxel ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\hooks\after_prepare\010_add_platform_class.js C:\Users\lienlab\Desktop\client\HybridApp_Zyxel
add to body class: platform-android
will push strings array {"name":"lang","titles":["English (US)","English (UK)"],"values":["en-us","en-gb"]}
android preferences file was successfully generated
ANDROID_HOME=C:\Users\lienlab\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_271
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_93e2b48xftftse4tgevu6kz4n.run(C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\platforms\android\build.gradle:138)
BUILD FAILED
Total time: 5.006 secs
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> The SDK directory 'C:\Users\User\AppData\Local\Android\sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
(node:14808) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> The SDK directory 'C:\Users\User\AppData\Local\Android\sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
at ChildProcess.whenDone (C:\Users\lienlab\Desktop\client\HybridApp_Zyxel\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:188:13)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
(node:14808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:14808) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
In one of my projects I get a gradle error message whenever I try to run code in debug mode (^D):
...
> Task :apps:travel-information-service:testClasses UP-TO-DATE
> Task :apps:travel-information-service:test FAILED
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/lx/lnqmbcy557ndwxld1hbsjlf00000gn/T/ijresolvers.gradle' line: 347
* What went wrong:
Execution failed for task ':apps:travel-information-service:test'.
> System property 'idea.debugger.dispatch.port' is not set
* 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 4s
Searching for this issue did not give any results.
It does not matter which code I try to debug (Java applications, junit tests, etc all give the same error). Running the code normally (non-debug mode) works fine. My other projects are fine using the same version of Intellij. I have tried rebooting, invalidating the caches in Intellij, reimporting the gradle project, and even completely removing the .idea directory.
Any tips on how to investigate (or even fix ;-)) this issue are greatly appreciated!
Using libGDX, and TomGrill's gdx-testing's tests subproject, and trying to run with gradle (gradlew tests:test) the default example from the examples directory and I get this error.
Testing started at 14:47 ...
14:47:05: Executing task 'test'...
Executing tasks: [test]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException (no error message)
* 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 0s
14:47:06: Task execution finished 'test'.
If I try to run it with IntelliJ's run-tests button
I get the error
Process finished with exit code 1
Class not found: "de.tomgrill.gdxtesting.examples.AssetExistsExampleTest"Empty test suite.
And last, if I try to run only one test from said suite I get the same error.
What am I doing wrong?
Turns out the error was with Gradle versions. I updated to the newest version of Android Gradle Google provides, and used a newer local Gradle as that was needed, and for some reason, this doesn't work. Made a new empty project and left the original Gradle versions, and the tests ran. There might be a better way to fix this, however, I'm going to go with this.
My project has an interesting issue with Gradle. When running "gradle build" from inside Intellij 13 (windows or linux), I get the following error message:
10:05:48 PM: Executing external task 'build'...
:processResources UP-TO-DATE
:compileAspect FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileAspect'.
> Error creating temporary file
* 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: 7.434 secs
Access is denied
10:05:56 PM: External task execution finished 'build'.
From here, I ran a full debug located here: Pastebin
Which shows it failing in the AjcTask.java file at the below line:
1993 tmpFile = File.createTempFile("argfile", "", userDir);
Might be related to GRADLE-1400 which is for and older version but unresolved. On linux, if I cd to the project directory, I can run "gradle build" without trouble after that first time, then I can run it from Intellij as well without an issue.
Maybe the environment vars getting nuke somehow?
It looks like GRADLE-2532.
user.dir property defaults to C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.1\jre\jre\bin in your case which causes Access Denied error.
In IDEA 13.1.2 and previous versions enabling Use customizable gradle wrapper option should help. This will set user.dir to the project root directory.
In IDEA 13.1.3 and later versions there are different workarounds available, check this comment.