cordova build android - my first app build failed - android

I try make a first app like in manual https://cordova.apache.org/docs/en/latest/guide/cli/index.html
but after command cordova build android
FAILURE: Build failed with an exception.
Where:
Settings file '/Users/roman2322/Desktop/cordova/7/hello/platforms/android/settings.gradle'
What went wrong:
Could not compile settings file '/Users/roman2322/Desktop/cordova/7/hello/platforms/android/settings.gradle'.
startup failed:
General error during conversion: Unsupported class file major version 62

Related

Flutter Fastlane Gitlab Build

I am new to Fastlane and want to build my apk through the Fastlane and Gitlab. I have been getting this error whenever I run the Fastlane command:
FAILURE: Build failed with an exception.
* Where:
Build file '/builds/sw/pro/pro_app_flutter/android/app/build.gradle' line: 30
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not read script '/Users/your-user/Library/Android/flutter/packages/flutter_tools/gradle/flutter.gradle' as it does not exist.
But I am unable to figure this out, what does this mean because flutter.gradle does exist on the path!
Moreover the build from Android Studio is successfully generated!
Thanks in advance
P.S my fast file:
default_platform(:android)
platform :android do
desc "Build a Flutter apk1"
lane :buildDebug do
gradle(task: "assemble", project_dir: 'android/')
end
end

Android Studio - OpenCV project wont build

I followed the instructions to import OpenCV to Android Studio here https://github.com/quickbirdstudios/opencv-android, after Android Studio wouldn't let me use the File > New > Import Module feature. After following the instructions, I get these build errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: H:\AndroidProjects\WyzeCloud\Rev1\IPCloud\app\build\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
============================================================================
2: Task failed with an exception.
What went wrong:
Execution failed for task ':app:compressDebugAssets'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
H:\AndroidProjects\WyzeCloud\Rev1\IPCloud\app\build\intermediates\merged_assets\debug\out
============================================================================
BUILD FAILED in 18s
Anyone know what these errors mean, or have a possible solution to importing OpenCV to an Android Studio project?
I faced this problem before and my solution:
Download the Android sdk of Open-CV from this link: https://opencv.org/releases/
Add the java and jni library files into your project. Java functions of this library is works with jni files (.so).

Ionic 3 prod release build issue with com.google.gms:google-services:3.2.0

I am creating release APK using the following versions : node - 8.12.0 gradle - 4.10.2 ionic CLI - 4.0.5 Cordova - 8.0.0
When I run the
ionic cordova build android --prod --release
I am getting the following error.
FAILURE: Build failed with an exception.
* Where:
Build file '/app/platforms/android/app/build.gradle' line: 94
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not find com.google.gms:google-services:3.2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom
https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.jar
https://repo1.maven.org/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom
https://repo1.maven.org/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.jar
Today there is a problem with repositories. It seems no one can build a project Could not find com.google.gms:google-services:4.1.0

Dex error when trying to build ionic Android app

I'm trying to build an ionic app for Android but when I run
ionic cordova run android
I get
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files
Trying to run ./gradlew clean gets me
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
I had the same issue but it was resolved. Thanks to information from #notlose at this link https://github.com/oney/react-native-gcm-android/issues/32
Solution:
just remove both 'build' folder in /android and /android/app
and build again with
'react-native run-android' for react-native
'ionic cordova run android' for ionic

Can't build project with minSdk = 21

I'm succesfully building the project with min sdks up to 20, but when i try to build with:
minSdkVersion 21
targetSdkVersion 21
I get an error:
:project:preDexDebug
no classfiles specified
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':project:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/user/android-sdk-macosx/build-tools/21.1.1/dx -JXmx2g --dex --multi-dex --output /Users/user/Project-Android/project/build/intermediates/pre-dexed/debug/tween-engine-api-sources-a613effab3e9735b093029491b18c5c4872bdf88.jar /Users/user/Project-Android/project/build/intermediates/exploded-aar/android-ui-client.gdxlibrary/android/unspecified/libs/tween-engine-api-sources.jar
Error Code:
1
Output:
no classfiles specified
I'm using libgdx in some places of the app.
Then the install dialog apears and if I choose a device I get another error:
Target device: genymotion-google_nexus_6___5_0_0___api_21___1440x2560-192.168.56.103:5555
Uploading file
local path: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk
remote path: /data/local/tmp/com.ui.client.debug
I/O Error: /Users/user/Project-Android/project/build/outputs/apk/project-debug.apk (No such file or directory)
And then an IDE dialog apears with error message:
Failed to complete Gradle execution.
Cause:
(just empty space after cause)
I had exactly the same problem. After running gradle with --debug option it turned out that gradle failed to process a jar file with no class files in it (a *-javadoc.jar).
Removing the file from /libs folder fixed the issue.

Categories

Resources