Ionic cordova emulate problem


#1
> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0

Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle

Requirements check results for ios:

Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]

CocoaPods: not installed 
/bin/sh: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Error: Some of requirements check failed
> cordova run android --list --emulator
Available android virtual devices:

Nexus_5_API_26
Nexus_6_API_23
ionic cordova emulate android --verbose
[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/gillesgodefroid/Documents/Test', local: false, binPath: 
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 2011)
> cordova platform add i --save
Using cordova-fetch for i

Adding i project...

Unable to load PlatformApi from platform. Error: Unhandled "error" event. (Does not appear to implement platform Api.)

Error: Unhandled "error" event. (The platform "i" does not appear to be a valid cordova platform. It is missing API.js. i not supported.)

[ERROR] Exception: 


#2

What is your ionic info output?


#3

My ionic info :

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.3.0 ios 4.5.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v8.9.1
    npm        : 5.5.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.1 Build version 9B55 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro


#4

There is a newer version available.


#5

How do I install this platform I thought I had all the versions up to date


#6

ionic cordova platform update android

or

ionic cordova platform rm android
ionic cordova platform add android


#7

Thanks a lot.

(more text)


#8

Hi I did the commands you told but the cordova android platform is still 3.6.0, and of course the result of emulate is the same…


#9

Then try the commands here:
https://cordova.apache.org/announcements/2017/11/09/android-release.html


#10

I did it and still bugs I send you the bug message and the new ionic info :

ionic cordova emulate android --verbose
[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/gillesgodefroid/Documents/Test', local: false, binPath: 
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 2011)
Running app-scripts build: --platform android --target cordova
[07:23:23]  build dev started ... 
[07:23:23]  clean started ... 
[07:23:23]  clean finished in 2 ms 
[07:23:23]  copy started ... 
[07:23:23]  deeplinks started ... 
[07:23:23]  deeplinks finished in 22 ms 
[07:23:23]  transpile started ... 
[07:23:26]  transpile finished in 2.58 s 
[07:23:26]  preprocess started ... 
[07:23:26]  preprocess finished in less than 1 ms 
[07:23:26]  webpack started ... 
[07:23:26]  copy finished in 2.72 s 
[07:23:32]  webpack finished in 5.99 s 
[07:23:32]  sass started ... 
[07:23:33]  sass finished in 948 ms 
[07:23:33]  postprocess started ... 
[07:23:33]  postprocess finished in 6 ms 
[07:23:33]  lint started ... 
[07:23:33]  build dev finished in 9.67 s 
> cordova emulate android
cp: copyFileSync: could not write to dest file (code=EACCES):/Users/gillesgodefroid/Documents/Test/platforms/android/res/xml/config.xml

Error: EACCES: permission denied, open '/Users/gillesgodefroid/Documents/Test/platforms/android/res/xml/config.xml'

[ERROR] An error occurred while running cordova emulate android (exit code 1).
        
[07:23:35]  lint finished in 2.20 s 
[DEBUG] registerShutdownFunction process.exit/normal shutdown

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.4.0 ios 4.5.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v8.9.1
    npm        : 5.5.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.1 Build version 9B55 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro


#11

Remove and re-add the platform again - this should not happen.
Did you do anything with sudo?


#12

I removed and re-add the platform my ionic info :

ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.4.0 ios 4.5.3
    Ionic Framework    : ionic-angular 3.8.0

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v8.9.1
    npm        : 5.5.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.1 Build version 9B55 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

and with the command ionic cordova emulate android --verbose , I get this message :

[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/gillesgodefroid/Documents/Sepaq', local: false, binPath: 
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 2011)
Running app-scripts build: --platform android --target cordova
[18:20:14]  build dev started ... 
[18:20:14]  clean started ... 
[18:20:14]  clean finished in 27 ms 
[18:20:14]  copy started ... 
[18:20:15]  deeplinks started ... 
[18:20:15]  deeplinks finished in 37 ms 
[18:20:15]  transpile started ... 
[18:20:20]  transpile finished in 4.95 s 
[18:20:20]  preprocess started ... 
[18:20:20]  preprocess finished in 1 ms 
[18:20:20]  webpack started ... 
[18:20:20]  copy finished in 5.98 s 
[18:20:28]  webpack finished in 8.27 s 
[18:20:28]  sass started ... 
[18:20:29]  sass finished in 1.31 s 
[18:20:29]  postprocess started ... 
[18:20:29]  postprocess finished in 8 ms 
[18:20:29]  lint started ... 
[18:20:29]  build dev finished in 15.35 s 
> cordova emulate android
ANDROID_HOME=/Users/gillesgodefroid/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle 
in your path, or install Android Studio

[ERROR] An error occurred while running cordova emulate android (exit code 1).
        
[18:20:32]  lint finished in 2.55 s 
[DEBUG] registerShutdownFunction process.exit/normal shutdown

#13

Better.

What does ionic cordova requirements return?

Install Gradle per these instructions: https://gradle.org/install/


#14

I installed Gradle following the instructions

ionic cordova requirements returns :

> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23

Gradle: installed /opt/gradle/gradle-4.3.1/bin/gradle

Requirements check results for ios:

Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]

CocoaPods: not installed 
/bin/sh: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Error: Some of requirements check failed

AND NOW IT WORKS !!! Thank you.

Best Regards

Gilles


#15

I get the same problem with ios :cold_sweat:

ionic info :

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.4.0 ios 4.5.3
    Ionic Framework    : ionic-angular 3.8.0

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v8.9.1
    npm        : 5.5.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.1 Build version 9B55 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

ionic cordova requirements :

> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0

Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23
Gradle: installed /opt/gradle/gradle-4.3.1/bin/gradle


Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]

ios-deploy: installed [object Object]
CocoaPods: not installed 
/bin/sh: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Error: Some of requirements check failed

ionic cordova emulate --list :

> cordova run --list --emulator
Available android virtual devices:

Nexus_5_API_26
Nexus_6_API_23
Available ios virtual devices:

iPhone-5s, 11.1
iPhone-6, 11.1
iPhone-6-Plus, 11.1
iPhone-6s, 11.1
iPhone-6s-Plus, 11.1
iPhone-7, 11.1
iPhone-7-Plus, 11.1
iPhone-8, 11.1
iPhone-8-Plus, 11.1
iPhone-SE, 11.1
iPhone-X, 11.1
iPad-Air, 11.1
iPad-Air-2, 11.1
iPad--5th-generation-, 11.1
iPad-Pro--9-7-inch-, 11.1
iPad-Pro, 11.1
iPad-Pro--12-9-inch---2nd-generation-, 11.1
iPad-Pro--10-5-inch-, 11.1
Apple-Watch-38mm, watchOS 4.1
Apple-Watch-42mm, watchOS 4.1
Apple-Watch-Series-2-38mm, watchOS 4.1
Apple-Watch-Series-2-42mm, watchOS 4.1
Apple-Watch-Series-3-38mm, watchOS 4.1
Apple-Watch-Series-3-42mm, watchOS 4.1
Apple-TV-1080p, tvOS 11.1
Apple-TV-4K-4K, tvOS 11.1
Apple-TV-4K-1080p, tvOS 11.1

ionic cordova emulate ios --target=“iPhone-8” --verbose :

[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/gillesgodefroid/Documents/Sepaq', local: false, binPath: 
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 2011)
Running app-scripts build: --platform ios --target cordova
[09:43:44]  build dev started ... 
[09:43:44]  clean started ... 
[09:43:44]  clean finished in 3 ms 
[09:43:44]  copy started ... 
[09:43:44]  deeplinks started ... 
[09:43:44]  deeplinks finished in 33 ms 
[09:43:44]  transpile started ... 
[09:43:47]  transpile finished in 2.66 s 
[09:43:47]  preprocess started ... 
[09:43:47]  preprocess finished in less than 1 ms 
[09:43:47]  webpack started ... 
[09:43:47]  copy finished in 2.85 s 
[09:43:55]  webpack finished in 7.71 s 
[09:43:55]  sass started ... 
[09:43:56]  sass finished in 988 ms 
[09:43:56]  postprocess started ... 
[09:43:56]  postprocess finished in 6 ms 
[09:43:56]  lint started ... 
[09:43:56]  build dev finished in 11.55 s 
> cordova emulate ios --target iPhone-8
cp: copyFileSync: could not write to dest file (code=EACCES):/Users/gillesgodefroid/Documents/Sepaq/platforms/ios/MyApp/config.xml

Error: EACCES: permission denied, open '/Users/gillesgodefroid/Documents/Sepaq/platforms/ios/MyApp/config.xml'

[ERROR] An error occurred while running cordova emulate ios --target iPhone-8 
        (exit code 1).
        
[09:43:58]  lint finished in 2.33 s 
[DEBUG] registerShutdownFunction process.exit/normal shutdown

#16

Tried removing and re-adding the platform?
Something is wrong with permissions on your machine :confused:


#17

Thanks it works.
Do you know the meaning of the word weekend ?
We don’t want you make a burn out !
Enjoy the day !
Bye
Gilles