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
Related
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)
everything was working fine i dont know what happend
no its not an XML file..not its not clean rebuild ..no its not sync ...sos what could it be...
this is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "seniorreminder.androidstudioprojects.com.seniorreminder"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
}
this is the error Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\User-Pc\AppData\Local\Android\Sdk\build-tools\25.0.3\aapt.exe'' finished with non-zero exit value -1073741818
please someone help
Your virus scanner (Avast for me) probably detected this threat as a false positive for malware. This happened and it alerted me. You must take it out of quarantine or allow it. If you can't, I recommend re-downloading build-tools version.
From: https://developer.android.com/studio/intro/update.html
"Open the SDK Manager from Android Studio, click Tools > Android > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool.
When an update is available for a package you already have, a dash appears in the check box next to the package.
To update an item or install a new one, click the check box so it shows a checkmark."
I am trying to build my project with AIDL example. But I keep getting this error:
:app:compileDebugAidl
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
Error:Execution failed for task ':app:compileDebugAidl'.
> com.android.ide.common.process.ProcessException:org.gradle.process.
internal.ExecException:
Process 'command 'C:\Users\xuefu\AppData\Local\Android\sdk\build-tools\23.0.1\aidl.exe''
finished with non-zero exit value 3
Information:BUILD FAILED
below is my build file and I am using Android Studio 1.3.2, Gradle 1.3.0 under the windows 8.1 x64 platform:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "org.crazyit.service"
minSdkVersion 10
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
Please check your aidl files, make sure all the files include the package name. e.g.
package com.zebra.gogogo;
parcelable GoInfo;
I'm a student programmer and I'm continuing an Android project that has been previously started by other students before me. My problem is that I'm getting an error when I try to execute the Android app inside Android Studio. You can see the error message below. The compilation must have worked for the other students since I have an apk file. What's wrong with zipalign?
:app:zipalignDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:zipalignDebug'.
> Process 'command 'X:\Sdk Android Studio\build-tools\21.1.2\zipalign.exe''
finished with non-zero exit value -1073741502
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "csf.dfc.friendtracker"
minSdkVersion 15
targetSdkVersion 21
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:21.0.3'
compile files('libs/guava-18.0.jar')
compile files('libs/Pubnub-Android-3.7.2.jar')
compile files('libs/mysql-connector-java-5.1.34-bin.jar')
}
EDIT:
I haven't found the cause of the error but I added all the project objects in a new one and the error disappeared.
Remove the apk file in the Deploy directory and the export worked fine then.
I realized this happen when you have the directory "..\app\build\outputs\apk\" open in your Windows Explorer. You just need to close it and rebuild the project.
This happened to me too, when I tried to generate the apk in the following path:
C:\users\desktop
Change your signed generated apk destination path used to generate to the following:
<your project path>\app\build\outputs\apk
Example:
E:\androidStudio\CountDownTimer\app\build\outputs\apk
Having an issue with a project that has trouble with the :app:preDexDebug task when trying to run app. Error received is:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Current settings:
Android Studio 0.8.1
Android Build Tools 20.0.0
Java 1.7_55
Windows 7
Even a default project does not run, although a gradle sync builds fine.
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\...\AppData\Local\Android\android-sdk\build-tools\20.0.0\dx.bat --dex --output C:\...\TestApplication\app\build\intermediates\pre-dexed\debug\support-v4-19.1.0-c0d17b20b65717b1b327ef7ea8fea7e8a443e7fe.jar C:\...\AppData\Local\Android\android-sdk\extras\android\m2repository\com\android\support\support-v4\19.1.0\support-v4-19.1.0.jar
Error Code:
1
Output:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.testapplication"
minSdkVersion 10
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
Resolved (on windows) by setting
set _JAVA_OPTIONS=-Xms512m -Xmx512m -XX:MaxPermSize=256m
Now script reports
Picked up _JAVA_OPTIONS: -Xms512m -Xmx512m -XX:MaxPermSize=256m
and works correctly.
What is strange, setting up variables GRADLE_OPTS and JAVA_OPTS had no effect.