android studio showing control as text - java

Android studio not showing the controls from 'com.android.support:support-v4:28.0.0' properly even if i added it in my build.gradle file
i have already tried setting AppTheme in my styles.xml to 'Base.Theme.AppCompat.Light.DarkActionBar' and tried multiple rebuilds
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
here the 'android.support.v4.widget.DrawerLayout' just shows as android.support.v4.widget.DrawerLayout in the preview
[this is what shows in the preview][1]
here's my gradle.build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.alto.alizer.altovpn"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
shrinkResources false
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}

Related

Plugin errors android studio

Seems to be one error with gradle version which I don't know how to fix.
I am using android studio. Not very knowledgeable, so will need basic instruction on how to fix this.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.finalyearrowingapp"
minSdkVersion 21
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Failed to resolve: com.google.android.material.material:1.0

I've been trying to get the floatingActionButton to work but it seems it's not working due to my gradle dependencies, the gradle code is shown below please i need some help on this,
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "-------------"
minSdkVersion 15
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'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.material.material:1.0.0-alpha1;'
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'
}
There's a typo in your dependency definition. Remove semi-colon at end and replace . with : between com.google.android.material and material:1.0.0-alpha1
So all together, change
implementation 'com.google.android.material.material:1.0.0-alpha1;'
To
implementation 'com.google.android.material:material:1.0.0-alpha1'

Could not find class 'dalvik.system....'

I am running one android application in version 4.4.4 After load application i can't tap any button and in logcat this is an error:
E/dalvikvm: Could not find class 'dalvik.system.DelegateLastClassLoader', referenced from method ab.b
This is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.app.name"
minSdkVersion 14
targetSdkVersion 28
versionCode 105
versionName "1.0.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.google.android.gms:play-services-ads:17.1.2'
}
In higher android versions everything works fine. Help please )
Reduce your compile sdk version and target version to 26
and change the appcompat-v7
to the following
com.android.support:appcompat-v7:26.0.0-beta1
then check run it.

Why does not my Android app work with some android versions?

I created my application. It works fine on my device, but I noticed that it does not work with some android versions (Android 7.1.1) My library supports android 4.2 and above. The device I tested is android 6.0. What could be the reason for this. How do I set it up for android 4.2?
My Grandle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
lintOptions {
abortOnError false
}
applicationId "test"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
resConfigs "en"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.+'
implementation 'com.android.support:design:27.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:cardview-v7:27.+'
implementation 'com.android.support:support-v4:27.+'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
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'
implementation 'com.flaviofaria:kenburnsview:1.0.7'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation "com.andkulikov:transitionseverywhere:1.7.9"
implementation 'com.baoyz.pullrefreshlayout:library:1.2.0'
implementation 'com.github.Hitomis:CircleMenu:v1.1.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
apply plugin: 'com.google.gms.google-services'

:app:processDebugResources Error in Android Studio

Not quite sure why I keep getting this error:
errors
After some searching, it seems like the issue is in my build.gradle file but I cannot find it. I've attached the file, but also include the screenshot of my errors in case there is something I am missing.
but that did not changed anything.
Build.gradle file below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.cormac.splashscreen"
minSdkVersion 17
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'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
}
refer this site
https://github.com/thevarungupta1/Android-Training-2/blob/master/SplashScreen/app/build.gradle
and
you seem forgot
implementation 'com.android.support:support-v4:28.0.0-alpha3'

Categories