"I tried to install my apk but it was giving this message.
Package seems to be corrupted.
this is my build.gradle file". However when I changed my compilesdkversion to 28 it was running. On directly running the app from android studio it is running but after generation apk it is not installing?
apply plugin: 'com.android.application'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 'android-Q'
defaultConfig {
applicationId "com.example.deskneedui"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.wdullaer:materialdatetimepicker:4.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:dc-volley:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.wdullaer:materialdatetimepicker:4.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
}
To fully test your app's compatibility with Android Q and begin using new APIs, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion as shown below
android {
compileSdkVersion 29
defaultConfig {
targetSdkVersion 29
}
}
FYI
Your classpath will be
classpath 'com.android.tools.build:gradle:3.4.1'
distributionUrl will be
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Related
I have the following problem: in android studio I want to load the library 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1' which I took from here: https://github.com/chthai64/SwipeRevealLayout
But android studio does not give me permission and gives me an error. Who knows how to solve this?
Code gradle:
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.justwork'
compileSdk 32
defaultConfig {
applicationId "com.example.justwork"
minSdk 22
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'
}
I looked at this library in the dialog box and saw that it was impossible to select a version for it. From which I conclude that for some reason android studio does not give me access to this resource.
I've spent couple of days trying to set it up but I got errors after adding firebase auth dependency in build.gradle file. Following are the errors:
org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at com.android.build.gradle.tasks.AndroidJavaCompile.compile(AndroidJavaCompile.kt:237)
I have tried many solutions but nothing worked for me. Please help
Following is my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services' // Google Services plugin
android {
compileSdkVersion 32
buildToolsVersion "32.0.0"
defaultConfig {
applicationId "com.example.startuplogin"
minSdkVersion 26
targetSdkVersion 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.firebase:firebase-auth:21.0.1'
}
When i try to sync my project or run a unit test it shows me the following error: Failed to resolve: org.junit.jupiter:junit-jupiter: Affected Modules: app
These are my dependencies:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.catalyst"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
androidTestImplementation 'org.junit.jupiter:junit-jupiter'
androidTestImplementation 'org.testng:testng:6.9.6'
}
I have met the same problem. The first comment gives me some tips. But it is not all for the answer.
firstly we should add the junit dependencies.
testImplementation 'junit:junit:{your version}'
then delete the org.junit.jupiter:junit-jupiter dependencies.
for me, it works well.
I need to generate a webhook url in android. Initially I tried Spring Framework, but it seems quite difficult to implement and I'm just looking to expose a single webhook url so I looked for a lightweight framework. I've now been trying to use spark-java, but I can't get it to run.
Error:
Suppressed: java.util.concurrent.ExecutionException: com.android.tools.r8.errors.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:552)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:513)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:86)
at com.android.tools.r8.utils.U0.a(:14)
at com.android.tools.r8.utils.U0.a(:9)
... 114 more
[CIRCULAR REFERENCE:com.android.tools.r8.errors.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)]
Caused by: com.android.tools.r8.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
And here's my build.gradle file:
plugins {
id 'com.android.application'
// id 'org.springframework.boot' version '2.3.3.RELEASE'
// id 'io.spring.dependency-management' version '1.0.10.RELEASE'
}
//apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.fivefaces.tauri"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.0.1'
compile "com.sparkjava:spark-core:2.9.2"
}
Gradle version is 6.6.1
In Project Structure, I already checked the defined Java SDK and it's correctly set to 1.8
Minimum Android SDK I'm using is API 16
I've been able to run a Spark server on Android. Here is my build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.mycom.appname"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.sparkjava:spark-core:2.9.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
We are both using Spark 2.9.2. I'm not too familiar with gradle but I notice that the way we indicate the dependency on it is different (compile "com.sparkjava:spark-core:2.9.2" vs. implementation 'com.sparkjava:spark-core:2.9.2').
I am developing on an app that uses the ActionBarSherlock library project, and the current project uses androidx dependences.
If Make Project will appear
android.support.v4.app not exist error.
error: can't find symbol
symbol: class FragmentActivity
error: package mFragments not exist
and so on...
My question is
1.How to be compatible with the previous android.support package in androidx?
2.How to migrate to androidx correctly which using the old android support library?
My build.gradle in module as follws:
1. build.gradle in Module:ActionBarSherlock which is a lib project of module app
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 4
targetSdkVersion 29
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
build.gradle in app which using the above ActionBarSherlock as lib project
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 15
targetSdkVersion 29
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
compile project(':ActionBarSherlock')
configurations.compile.exclude module: 'support-v4'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
implementation 'com.actionbarsherlock:library:4.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
ActionBarSherlock is deprecated. No more development will be taking
place.
As it says in its official repository
So I remind you not to use that library.