Error run app on device


#1

Hi,

When I try run my app in an android device a receive an error:

Total time: 1.358 secs
Built the following apk(s):
/home/jacques/desenvolvimento/mobile/ionic2/IonicCLI2/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/home/jacques/android-sdk/
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: spawn ELOOP

My system is Ubuntu 14.04, any one know how fix these?


#2

That’s a new one. Does the generated APK work if you copy it to the device manually?


#3

Yes works fine if I copy to device.


#4

What is your ionic infooutput?
Run the same command with --verbose at the end please.


#5

My ionic info is:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 6.3.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.9.1
    OS         : Linux 3.13
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.9 

Run with verbose output:


[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --externalIpRequired --nobrowser

[09:34:56]  build dev started ... 
[09:34:56]  clean started ... 
[09:34:56]  clean finished in 51 ms 
[09:34:56]  copy started ... 
[09:34:56]  transpile started ... 
[09:35:01]  transpile finished in 5.04 s 
[09:35:01]  preprocess started ... 
[09:35:01]  deeplinks started ... 
[09:35:01]  deeplinks finished in 18 ms 
[09:35:01]  preprocess finished in 19 ms 
[09:35:01]  webpack started ... 
[09:35:02]  copy finished in 6.12 s 
[09:35:11]  webpack finished in 9.72 s 
[09:35:11]  sass started ... 
[09:35:13]  sass finished in 1.60 s 
[09:35:13]  postprocess started ... 
[09:35:13]  postprocess finished in 5 ms 
[09:35:13]  lint started ... 
[09:35:13]  build dev finished in 16.59 s 
> cordova run android --device
[09:35:17]  lint finished in 3.87 s 
ANDROID_HOME=/home/jacques/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (subsequent builds will be faster).

Incremental java compilation is an incubating feature.
:preBuild
 UP-TO-DATE
:preDebugBuild
 
UP-TO-DATE
:checkDebugManifest

:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugAidl
 
UP-TO-DATE
:CordovaLib:compileDebugNdk
 UP-TO-DATE
:CordovaLib:compileLint
 UP-TO-DATE
:CordovaLib:copyDebugLint
 UP-TO-DATE
:CordovaLib:mergeDebugShaders
 
UP-TO-DATE
:CordovaLib:compileDebugShaders
 UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
 
UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles
 UP-TO-DATE
:CordovaLib:packageDebugRenderscript
 
UP-TO-DATE
:CordovaLib:compileDebugRenderscript
 
UP-TO-DATE
:CordovaLib:generateDebugResValues
 
UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources
 
UP-TO-DATE
:CordovaLib:processDebugManifest
 UP-TO-DATE
:CordovaLib:generateDebugBuildConfig
 UP-TO-DATE
:CordovaLib:processDebugResources
 
UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard
 
UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac
 UP-TO-DATE
:CordovaLib:processDebugJavaRes
 UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
 UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
 UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders
 
UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
 UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
 UP-TO-DATE
:CordovaLib:bundleDebug
 UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary
 UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl

:compileDebugRenderscript

:generateDebugBuildConfig

:generateDebugResValues
 UP-TO-DATE
:generateDebugResources
:mergeDebugResources

:processDebugManifest

:processDebugResources

:generateDebugSources

:incrementalDebugJavaCompilationSafeguard

:compileDebugJavaWithJavac

:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileDebugNdk
 
UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
 
UP-TO-DATE
:compileDebugShaders
 
UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets

:transformClassesWithDexForDebug

:mergeDebugJniLibFolders
 
UP-TO-DATE
:transformNative_libsWithMergeJniLibsForDebug
 
UP-TO-DATE
:processDebugJavaRes
 
UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
 
UP-TO-DATE
:validateSigningDebug

:packageDebug

:assembleDebug
:cdvBuildDebug


BUILD SUCCESSFUL

Total time: 21.725 secs
Built the following apk(s): 
	/home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/build/outputs/apk/android-debug.apk

ANDROID_HOME=/home/jacques/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: spawn ELOOP


[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] An error occurred while running cordova run android --device (exit code 1).

#6

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Damn, not much more useful output. Shame.

It might be worth upgrading these two:

to CLI 7.x and android 6.2.x (npm install -g cordova and then remove and re-add the android platform to do that).


#7

I upgrade Cordova, but the problem persists:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.9.1
    OS         : Linux 3.13
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.9 

jacques@jacques-Vostro-3560:~/desenvolvimento/mobile/ionic2/samapp$ cordova run android --device --verbose
No scripts found for hook "before_run".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/assets/www
Wrote out android application name "Drogaria Santa Marta" to /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (0.0.1): 1
Wrote out Android package name "com.conticenter.samapp" to /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/src/com/conticenter/samapp/MainActivity.java
Updating icons at platforms/android/res
Updating splash screens at platforms/android/res
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
ANDROID_HOME=/home/jacques/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Subproject Path: CordovaLib
Running command: /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/gradlew cdvBuildDebug -b /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true
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_925jjztg5974xtj29s4u1wwcv.run(/home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:transformClassesWithDexForDebug UP-TO-DATE
:mergeDebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:validateSigningDebug
:packageDebug UP-TO-DATE
:assembleDebug UP-TO-DATE
:cdvBuildDebug UP-TO-DATE

BUILD SUCCESSFUL

Total time: 1.326 secs
Command finished with error code 0: /home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/gradlew cdvBuildDebug,-b,/home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
Built the following apk(s): 
	/home/jacques/desenvolvimento/mobile/ionic2/samapp/platforms/android/build/outputs/apk/android-debug.apk
No scripts found for hook "before_deploy".
ANDROID_HOME=/home/jacques/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Running command: adb devices
Error: spawn ELOOP


#8

Then this is a case for the Cordova people over at http://issues.cordova.io - not much we can do as I have no idea how to find out what exactly is going wrong. They might.


#9

Ok thanks for your help.


#10

Hi,

I open a issue in Cordova project and they say this:

Joe Bowser added a comment - 10 minutes ago - edited

This definitely looks like an ionic issue or an issue with hooks. Are you using hooks, because I don’t know why those are being mentioned. It’s clear that some sort of script that you’re running is causing the build to be stuck in a loop.

But I try run an blank template app without any modification and not work.


#11

Provide link to the issue please.


#12

Follow the requested link:

https://issues.apache.org/jira/browse/CB-12936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16056431#comment-16056431


#13

You ran a pure Cordova command. I don’t know how Ionic could influence that.