how to run cordova project in manjaro - javascript

I have problem using cordova, I new in cordova, well, my problem is whe I try run the project is show me an error. like this:
FAILURE: Build failed with an exception.
* Where:
Settings file
'/home/ngel/Projects/cordova_lab/novaCrud/platforms/android/settings.gradle'
* What went wrong:
Could not compile settings file
'/home/ngel/Projects/cordova_lab/novaCrud/platforms/android/settings.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
first a create project like this:
cordova create testprj
then add platform
cordova platform add android
and finally
cordova run android
and show me the error above.
my gradle is 6.9.1,
OS manjaro
please help me.
thanks for your advice.

Related

Unable to solve Android target error in Meteor add-platform android

I using a Macbook Pro M1 and decided to do start developing mobile app using Meteorjs framework, since I've used the framework for web development. I've followed a tutorial online on how to get that going but currently facing a problem:
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: Command failed with exit code 1: avdmanager list target
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 5 more
✓ Gradle
It seems that there's only one requirement that failed, and I've searched for the solution but couldn't find anything that resembles a similar problem that I'm facing. Hoping for you to help point me to the right direction.
I have installed the Android Studio, uninstalled and reinstalled the Android SDK Build-Tools 32, Android SDK Command-line Tools, Android SDK Platform-Tools, and Android Emulator.
Currently, my ~/.bashrc file setup is like this:
export ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
...and my ~/.bash_profile:
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib
and I've got Gradle working just fine. Tested building a generic Android app using one of the samples in Android Studio. The build was successful.
But I can't get the meteor add-platform android to pass the checks. Anyone?
This problem was solved by installing JDK8.
Source for Macbook Pro M1: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk

How Can I run react-native app in my mobile because avd is too slow

Please help me. My React Native app is not running in my mobile. It works fine on the android simulator, but the performance is quiet bad.
The error is:
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier"
flag.
Jetifier found 967 file(s) to forward-jetify. Using 2 workers...
info Starting JS server...
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* 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 8s
error Failed to install the app. Make sure you have the Android development environment set up:
https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Com
mand failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
This might be because lower version of Jdk. Please update JDK version supported by Android Studio
For Reff : Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Try React Native environment to upgrade your environment because there is a thread in here Grovy Error
It's simple , just connect your mobile with Android studio and on the developing mode , then select the device from Android studio and run the project the app will simply open on your phone , unless you don't have any errors in enviornment.

React Native, why react-native run-android not working?

I'm trying to run react native run-android after I update my project file, but whenever I run react-native it throws an error. When I created that project and that command it worked fine but when I edit and add some files like apps/redux, apps/components, screens etc it stopped working. Can anyone tell me why it's not working?
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :app:compileDebugJavaWithJavac
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 6 executed, 21 up-to-date
Note: C:\Users\Danger World\ReactProject\android\app\src\debug\java\com\reactproject\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* 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 1m 11s
error Failed to install the app. Make sure you have an Android emulator running or a device connected. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: C:\Users\Danger World\ReactProject\android\app\src\debug\java\com\reactproject\ReactNativeFlipper.java uses or overrides a deprecated API.
you either need to create a virtual device or connect a physical device with USB debuging enabled (https://developer.android.com/studio/debug/dev-options).
To create a virtual device, open android studio and select AVD manager from Configure menu and create a new virtual device downloading required packages.
In case you are using a virtual device with Android studio then try to manually run the emulator BEFORE react-native run-android.
(open android studio > Tools > AVD Manager > Create Virtual Device)
https://developer.android.com/studio/run/managing-avds#createavd
Or repeat the official installation guide:
https://reactnative.dev/docs/environment-setup

Cordova Android Build Failure ("failed to find Build Tools revision 24.0.1")

I'm having trouble building my Cordova project with Android. When I typed "cordova build Android", this is the result:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find Build Tools revision 24.0.1
I checked my SDK manager and the build tools version 24.0.1 are installed. I was building earlier just fine so I'm not sure what changed. Any help would be appreciated. Thanks!
I'd start by making sure that your PATH environment/system variable includes paths to the various Android tools, and also that you have an ANDROID_HOME entry pointing to the SDK
Partial PATH example (on Windows):
C:\Program Files (x86)\Android\android-sdk\tools;
C:\Program Files (x86)\Android\android-sdk\platform-tools;
ANDROID_HOME example (on Windows):
C:\Program Files (x86)\Android\android-sdk

PhoneGap: Error on phonegap run android

I'm trying to run
phonegap run android --device={device id here}
but everytime I try to run the phonegap application the following takes place:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project.
/home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at /home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:87:29
at _rejected (/home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
at /home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
at Promise.when (/home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
at /home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
at flush (/home/lightshire/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
My paths are completely set
adb
ant
fastboot
java
are all working
I ran echo $PATH and got the following
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/lightshire/adt/adt-bundle-linux-x86_64-20131030/sdk/platform-tools:/home/lightshire/ant/bin
I also updated the android API, I figured out that the problem would be my device since its 2.3 so I downloaded all the android API including 2.3 to 4.4 but I still got the same error. I'm actually stumped on what the problem might be.
Did you set all paths are correctly?
E:\ant\bin; -ant path
C:\Program Files\Java\jdk1.7.0_13\bin; -java path
E:\Node; -Node path
E:\Eclipse\sdk\platform-tools; -SDK platform tool path
E:\Eclipse\sdk\tools; -SDK tool path
C:\Users\Account\Account\Roaming\npm; -npm path

Categories