Build failed with an exception in QT/android-armv7 - android

I cant build armv7 in qt/android. Where do I need to set in Qt or Android Studio?
This is for a Qt 5.12.2, compiler is Android for armeabi-v7a and Android Studio (sdk and ndk-bundle)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.smewise.camera2"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.13-beta-3'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}
Build log:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugAidl'.
> java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\cansunurk\AppData\Local\Android\Sdk\build-tools\29.0.0\aidl.exe with arguments {-pC:\Users\cansunurk\AppData\Local\Android\Sdk\platforms\android-28\framework.aidl -oC:\Users\cansunurk\Documents\build-denemee-Android_for_armeabi_v7a_Clang_Qt_5_13_0_for_Android_ARMv7-Debug\android-build\build\generated\source\aidl\debug -IC:\QtCreator\5.13.0\android_armv7\src\android\java\src -IC:\Users\cansunurk\Documents\build-denemee-Android_for_armeabi_v7a_Clang_Qt_5_13_0_for_Android_ARMv7-Debug\android-build\src\debug\aidl -IC:\Users\cansunurk\Documents\build-denemee-Android_for_armeabi_v7a_Clang_Qt_5_13_0_for_Android_ARMv7-Debug\android-build\src -IC:\Users\cansunurk\Documents\build-denemee-Android_for_armeabi_v7a_Clang_Qt_5_13_0_for_Android_ARMv7-Debug\android-build\aidl -dC:\Users\CANSUN~1\AppData\Local\Temp\aidl8998818284823510668.d C:\QtCreator\5.13.0\android_armv7\src\android\java\src\org\kde\necessitas\ministro\IMinistro.aidl}
* 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
BU?LD FAILED in 14s
3 actionable tasks: 1 executed, 2 up-to-date
Building the android package failed!
-- For more information, run this command with --verbose.
10:44:02: The process "C:\QtCreator\5.13.0\android_armv7\bin\androiddeployqt.exe" exited with code 14.
Error while building/deploying project denemee (kit: Android for armeabi-v7a (Clang Qt 5.13.0 for Android ARMv7))
When executing step "Build Android APK"
10:44:02: Elapsed time: 00:20.

I solved this problem by SDK Build-Tools. If have same problem, need follow this way,
Android Studio>Setting>Android SDK> SDK Tools(Show Package Details)> Version 29 (Unchecked)

Related

How to fix NDK build error for HelloCardboard sample

I am trying to compile Google Cardboard Sdk sample.
I am following instructions given by google's official docs
I am stuck at step 3, where I am supposed to assemble the project:
This is the error I am getting when I start to assemble:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':hellocardboard-android:externalNativeBuildDebug'.
> Build command failed.
Error while executing process C:\Users\Shanu\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C C:\Projects\cardboard\hellocardboard-android\.cxx\cmake\debug\x86 cardboard_jni}
ninja: Entering directory `C:\Projects\cardboard\hellocardboard-android\.cxx\cmake\debug\x86'
ninja: error: '../../../../libraries/jni/x86/libcardboard_api.so', needed by '../../../../build/intermediates/cmake/debug/obj/x86/libcardboard_jni.so', missing and no known rule to make it
* 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 4s
29 actionable tasks: 2 executed, 27 up-to-date
1:55:12 PM: Task execution finished 'assemble'.
Then I tried to run with --stacktrace
Caused by: org.gradle.internal.UncheckedException: Build command failed.
But there is an additional warning:
WARNING: This app only has 32-bit [armeabi-v7a,x86] native libraries. Beginning August 1, 2019 Google Play store requires that all apps that include native libraries must provide 64-bit versions. For more information, visit https://g.co/64-bit-requirement
Well, that doesn't give me an idea, as to have never used NDK/Cardboard SDK ever before.
Here is how the build.gradle(hellocardboard) looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.google.cardboard.hellocardboard"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
externalNativeBuild {
cmake {
cppFlags "-std=gnu++11"
arguments "-DANDROID_STL=c++_shared"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// Android Mobile Vision
implementation 'com.google.android.gms:play-services-vision:15.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation project(":sdk")
}
// The dependencies for NDK builds live inside the .aar files so they need to
// be extracted before NDK targets can link against.
task extractNdk(type: Copy) {
if (file("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar").exists()) {
copy {
from zipTree("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar")
into "libraries/"
include "jni/**/libcardboard_api.so"
}
copy {
from "${project.rootDir}/sdk/include/cardboard.h"
into "libraries/"
}
}
}
task deleteNdk(type: Delete) {
delete "libraries/jni"
delete "libraries/cardboard.h"
}
build.dependsOn(extractNdk)
clean.dependsOn(deleteNdk)
Here is the whole project hosted on my GitHub
Everything is at google's default settings, and I haven't configured anything, except
Install these components from the SDK manager:
CMake
LLDB
NDK (Side by Side)
What is the issue here and how can I fix it?
This usually happens when you haven't built the SDK.
The sample app tells you to click the "assemble" option in the Gradle tab. You should click the "assemble" option under ":sdk", not the one under ":hellocardboard-android".
The official instructions are unclear about this; it is only visible if you look closely at the screenshots there.

A problem occurred evaluating project ':app'

I cloned a working project from git , and starting to run it but this error shown up. However on another laptop it works fine showing no errors. that I thought the problem is my laptop, but trying to run a different projects and they worked successfully
ProcessException: Process "E:\cantina-customer\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file 'E:\cantina-customer\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* 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 2s
Command: E:\cantina-customer\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
and here my build.gradle/appLevel
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "app.cantina.customer"
minSdkVersion 21
targetSdkVersion 28
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
I have tried to run a different application and it worked fine without any errors , any idea on How can I solve this in this project specifically?

Travis CI Build failing on Android app Unsupported major.minor version 52

I'm trying to build using Travis CI on my Android project with this .travis.yml file
language: android
android:
components:
- platform-tools
- tools
- build-tools-23.0.3
- android-23
- sys-img-armeabi-v7a-android-23
- sys-img-x86-android-23
Here is my app level build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.myname.myproject"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
testCoverageEnabled = true
}
}}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
testCompile "org.robolectric:robolectric:3.1.2"
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
I am getting this failure message on Travis CI:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/travis/build/myname/myproject/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> 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
From the error, it seems that it has something to do with the Java version. I notice that Travis uses Java version 1.7.0_76.
I have tried some of the solutions at Unsupported major.minor version 52.0 in my app. None of them have worked for me. For instance, this doesn't seem to work:
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
UPDATE: I fixed this by adding jdk: oraclejdk8 to the second line of my .travis.yml file after language:android
UPDATE: I fixed this by adding jdk: oraclejdk8 to the second line of my .travis.yml file after language:android

Error:(24, 11) Failed to resolve: com.android.support:appcompat-v7:8.0.+

Pleas help with this error cause it's my first android project !
Gradle Sync:
pply plugin: 'com.android.application'
android {
compileSdkVersion 8
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.interceptor.myapplication"
minSdkVersion 5
targetSdkVersion 8
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:8.0.+'
}
On Gradle console i get:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find any version that matches com.android.support:appcompat-v7:8.0.+.
Versions that do not match:
24.0.0-alpha1
23.2.1
23.2.0
23.1.1
23.1.0
+ 14 more
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/appcompat-v7/
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/maven-metadata.xml
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/maven-metadata.xml
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/
Required by:
MyApplication:app:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
You should use the correct version for the appcompat-v7 dependency.
The latest stable version of the above-mentioned dependency to now is:
compile 'com.android.support:appcompat-v7:23.2.1'
Use it as above and make sure you installed/updated to the latest version in SDK Manager before.

Apps not showing in virtual device Android Studio

I'm currently learning android development but am running a small problem. The last two apps I've attempted to run (Following Bucky's android tutorials) have failed to appear in my virtual device.
This is my build log:
11:58:36 AM Gradle sync started
11:59:14 AM Gradle sync completed
11:59:16 AM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]
11:59:30 AM Gradle build finished in 12s 258ms
12:19:21 PM Executing tasks: [:app:assembleDebug]
12:19:24 PM Gradle build finished with 15 error(s) in 3s 20ms
12:19:33 PM Executing tasks: [:app:assembleDebug]
12:19:56 PM Gradle build finished in 22s 797ms
12:32:59 PM Executing tasks: [:app:assembleDebug]
12:33:01 PM Gradle build finished in 1s 608ms
My build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.alex.buckysgestures"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
Please help!
You have successfully built your app, now you should install it on device. Be sure some device is connected (or virtual device), and run
./gradlew installDebug

Categories

Resources