I'm running android studio on 32 bit ubuntu 16.04, and I'm trying to run my application.
When I run gradlew it works fine for me, but when I'm ready to build the apk and run it on my device, it shows my everytime:
My gradle (app) file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(
'com.android.tools.build:gradle:2.3.3',
"com.neenbedankt.gradle.plugins:android-apt:1.8",
)
}
}
apply plugin: "com.android.application"
apply plugin: "com.neenbedankt.android-apt"
repositories {
jcenter()
}
android {
compileSdkVersion 17
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.clarifai.android.starter.api.v2"
minSdkVersion 15
targetSdkVersion 17
versionCode 2
versionName "1.1"
}
lintOptions { lintConfig rootProject.file('gradle/lint.xml') } // needed to suppress Okio's lint errors
}
dependencies {
compile(
"com.android.support:appcompat-v7:24.2.1",
"com.android.support:recyclerview-v7:24.2.1",
"com.android.support:design:24.2.1",
"com.clarifai.clarifai-api2:core:2.2.+",
// For logging our HTTP outbound + inbound data
"com.jakewharton.timber:timber:4.3.0",
"com.squareup.okhttp3:logging-interceptor:3.4.1",
// For runtime permissions on Marshmallow and above
"io.reactivex:rxjava:1.1.10",
"com.tbruyelle.rxpermissions:rxpermissions:0.7.1#aar",
)
compile('com.mikepenz:materialdrawer:5.6.0') { transitive = true }
// For getting views without clunky findViewById
compile 'com.jakewharton:butterknife:8.4.0'
apt "com.jakewharton:butterknife-compiler:8.4.0"
}
(sorry for the bad indents)
Please help me understand what the problem is.
I was trying all the suggestions in the net so far to my problem, but none helped.
Related
After importing the zip project in android studio, I am getting the following error:-
Could not find com.android.tools.build:gradle:2.2.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
Required by:
:Parse-Server-Starter-Project:unspecified
Add google Maven repository and sync project
Open File
My Gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
ext {
compileSdkVersion = 22
buildToolsVersion = "23.0.1"
minSdkVersion = 9
targetSdkVersion = 23
}
How to solve this issue?
in repositories tag add google(),
also comment buildtoolsversion = '23.0.1'
compilesdkversion and targetsdkversion must be same.
Kindly do the changes and let us know.
I am trying to import a project in Android Studio. This code supposedly works but I cannot seem to be able to build the project. This is the error that is produced when I am trying to build:
Error:Execution failed for task
':openCVLibrary2410:compileReleaseJava'.
Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to
point to the according directory.
I have searched for a solution, but what I found was was either referring to eclipse or changing the jdk position for
File > other Settings > Default Project Structure
Which is not a valid solution for me because I checked my previous Android Studio Projects and all have the same position
This is the stacktrace:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':openCVLibrary2410:compileReleaseJava'.
mainProject Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
FaceRecognition Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "eu.upcom.recred.facerec"
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/javacpp.jar')
compile files('libs/javacv.jar')
compile project(':openCVLibrary2410')
}
openCV2410 gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
While I was posting here the gradle files my eye caught something. I changed the build tools version from 'com.android.tools.build:gradle:1.1.0' to 'com.android.tools.build:gradle:2.2.2'and now it is building as it should
I had same problem, Here is problem on Java path. You can check you have set path of your java or JDK in system variable or not click Environment variable
Also check your Java JDK version.
Also this link have all details of How to set path.
I suggest to you can use this solution. It will be help to resolve your problem..
I build a player based VLC,and when I want to build a verson for Android 6.0,player can't start on Android 6.0 device.Here are the log:Can't load vlcjni library:java.lang.UnsatisfiedLinkError:dlopen failed:/data/app/lib/arm/libvlcjni.so: has text relocations.
And I have tried so many ways to solve it,but I haven't solve it yet.
I hope anyone can tell me about the problem.
Here is similar question and answers: libavcodec.so: has text relocations
Today, I got the same error messages when testing my app with Android 6.0 on a Nexus 6 (Motorola). I solved my issue by checking the targetSDKVersion in the manifest file. Using "22" and not "23" as targetSDKVersion solved it. (See below)
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="22" />
I also checked the build.gradle files for compile version and targetSDKversion:
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
}
Hope this will help you. However, this is just a short term workaround for now, I hope that we will get some feedback from metaio though.
Regards, christin
I only had to create a libs folder in my Android library, and then move the library files from the jniLibs folder to the libs folder. I believe this may have to do with the newer version of Gradle and build tools. That way, you don't have to downgrade your build tools/Gradle.
UPDATE:
I was able to build with the following build.gradle script for vlc-android. I needed the following updated versions. This allows me to build with SDK version 24, with build tools 24, and gradle version 2.2.0. See if this works for you.
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'org.ajoberstar:gradle-git:1.3.2'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
//noinspection GradleCompatible
compile "com.android.support:support-v4:25.2.0"
compile 'com.android.support:support-annotations:25.2.0'
}
I am using Android studio version 1.2 and i am going to use the Facebook SDK to create an application that will allow the user to post in their wall. But when i import the module or the Facebook SDK i am currently getting this error.
Error:(15, 0) Could not find property 'ANDROID_BUILD_SDK_VERSION' on project ':facebook'.
My downloaded sdk is the latest one. this is the name of the zip file when i downloaded. facebook-android-sdk-4.4.1
This is the build.gradle that i have.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.example.jerex.facebook"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
This is the another build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
I do not put codes yet because i am just implementing the facebook sdk but i keep on having this error. thats why i cannot start working with code
Just add this code in the facebook\build.gradle just find that gradle and change this code
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 8
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}
to this code.
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
}
I tried many options from google and stackoverflow.
Android studio 0.4.6 and aa 2.7.1.
My build.gradle looks like this
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
ext.daggerVersion = '1.0.0';
ext.androidAnnotationsVersion = '2.7.1';
configurations {
apt
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
apt "com.googlecode.androidannotations:androidannotations:${androidAnnotationsVersion}"
compile "com.googlecode.androidannotations:androidannotations-api:${androidAnnotationsVersion}"
apt "com.squareup.dagger:dagger-compiler:${daggerVersion}"
compile "com.squareup.dagger:dagger:${daggerVersion}"
}
I've checked Activities_ in AndroidManifest.xml too.
If this quesion were not banned due to other "similar" questions I would prefer answers from people who did it with exacly the same as version. I know there will be next version's and maybe new questions but this looks litle tricky imho. Even though android development with aa is very robust.
"sync project with gradle files", clean, rebuild etc brings no effect.
EDIT:
I tryied with
ext.daggerVersion = '1.2.0';
ext.androidAnnotationsVersion = '3.0.1';
but it brings no result.
After switching to:
classpath 'com.android.tools.build:gradle:0.8.+'
and
ext.daggerVersion = '1.2.0';
it builds succesfully but outputs with:
Default Activity not found
I checked Error: Default Activity Not Found with no effect.
It looks like you need to add the android-apt dependency within the BuildScript dependencies and let gradle know to use it as a plugin.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
This is my apt config section, you may need other settings but this should get you started
apt {
arguments {
resourcePackageName android.defaultConfig.packageName
androidManifestFile variant.processResources.manifestFile
}
}
Lot's more info here: https://bitbucket.org/hvisser/android-apt