[10:23:34] build dev started …
[10:23:34] clean started …
[10:23:34] clean finished in 4 ms
[10:23:34] copy started …
[10:23:34] transpile started …
[10:23:36] transpile finished in 1.84 s
[10:23:36] preprocess started …
[10:23:36] deeplinks started …
[10:23:36] deeplinks finished in 13 ms
[10:23:36] preprocess finished in 14 ms
[10:23:36] webpack started …
[10:23:36] copy finished in 1.97 s
[10:23:43] webpack finished in 6.91 s
[10:23:43] sass started …
[10:23:43] sass finished in 740 ms
[10:23:43] postprocess started …
[10:23:43] postprocess finished in 6 ms
[10:23:43] lint started …
[10:23:43] build dev finished in 9.56 s
⠼ running command: cordova build android [10:23:45] lint finished in 1.75 s
running command: cordova build android - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=/opt/android-sdk/
JAVA_HOME=/usr/lib/jvm/default-java
Subproject Path: CordovaLib
FAILURE: Build failed with an exception.
* Where:
Build file '/var/www/html/ionic/myApp/platforms/android/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'android'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* 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: 1.006 secs
Error: /var/www/html/ionic/myApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file '/var/www/html/ionic/myApp/platforms/android/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'android'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
it means mobile is not attached with your computer to run the build. you can find that built apk in android platform…
or in mobile usb debugging is not enabled
ok yes u r right will check with android studio thanks buddy
one more thing my code is like this
register() {
this.sqlite.create({
name: ‘data.db’,
location: ‘default’
})
.then((db: SQLiteObject) => {
db.executeSql(‘create table danceMoves(name VARCHAR(32))’, {})
.then(() => console.log(‘Executed SQL’))
.catch(e => console.log(“after then catch”+e));
})
.catch(e => console.log(“in catch”+e));
}
when I am calling register function its throwing this error
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
Native: tried accessing the SQLite plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordova_not_available
just want to know this also will get resolved by emulator or this is diffrerent
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=/opt/android-sdk/
JAVA_HOME=/usr/lib/jvm/java-8-oracle:/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /opt/android-sdk/tools/templates/gradle/wrapper
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=/home/nikhil/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'wrapper' not found in root project 'android'.
* Try:
Run gradle tasks to get a list of available tasks.
BUILD FAILED
Total time: 3.826 secs
Error: /usr/share/gradle/bin/gradle: Command failed with exit code 1
Can’t help, but:
Please 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.
I’m also having the same problem, When compiling or constructing using ionic cordova command.
This I get in console
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
ANDROID_HOME=C:\Users\frankito\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Error: Cannot read property 'length' of undefined
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\frankito\Documents\Ionic\ValorAgregado>ionic cordova build android --verbose
[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: --iscordovaserve --externalIpRequired --nobrowser
[12:43:54] build dev started ...
[12:43:54] clean started ...
[12:43:54] clean finished in 38 ms
[12:43:54] copy started ...
[12:43:54] transpile started ...
[12:44:03] transpile finished in 8.94 s
[12:44:03] preprocess started ...
[12:44:03] deeplinks started ...
[12:44:03] deeplinks finished in 230 ms
[12:44:03] preprocess finished in 264 ms
[12:44:03] webpack started ...
[12:44:04] copy finished in 9.85 s
[12:44:29] webpack finished in 25.52 s
[12:44:29] sass started ...
[12:44:36] sass finished in 7.42 s
[12:44:36] postprocess started ...
[12:44:36] postprocess finished in 39 ms
[12:44:36] lint started ...
[12:44:37] build dev finished in 42.56 s
> cordova build android
[12:44:54] lint finished in 17.45 s
✖ Running command - failed!
[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 build android (exit code 1):
ANDROID_HOME=C:\Users\frankito\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Error: Cannot read property 'length' of undefined
No scripts found for hook "before_build".
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 C:\Users\frankito\Documents\Ionic\ValorAgregado\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 "ValorAgregado" to C:\Users\frankito\Documents\Ionic\ValorAgregado\platforms\android\res\va
lues\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.ionicframework.valoragregado971053" to C:\Users\frankito\Documents\Ionic\ValorAgregado\pla
tforms\android\src\com\ionicframework\valoragregado971053\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".
No scripts found for hook "before_compile".
ANDROID_HOME=C:\Users\frankito\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
Error: Cannot read property 'length' of undefined