• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

I have few problems with android studio

Mohamed13

Lurker
1, I am trying to put an image on my design but it doesn't show up. I put the code in and the code is...
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="@drawable/blue_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="128dp"
tools:ignore="MissingConstraints"
android:contentDescription="@String/todo"/>

2. Why Emulator isn't showing my app what I create in android studio?
I created my app but for some reason it isn't showing up on emulator screen instead it shows normal phone screen.

3. Compilation errors "This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first."
Please help me
 
Last edited:
Why not to start your app in debugging mode on an emulator and then do step-by-step debug?
It will be the same and have a error message.
upload_2021-1-10_14-46-40.png
 

Attachments

  • upload_2021-1-10_14-47-24.png
    upload_2021-1-10_14-47-24.png
    271.6 KB · Views: 499
Is your project an old one? It seems to show a lack of signing configuration for your project.

Android Studio automatically stores your debug signing information in a signing configuration so you do not have to enter it every time you debug. A signing configuration is an object consisting of all of the necessary information to sign your app, including the keystore location, keystore password, key name, and key password.

So, create a new project and then copy all your codes into it in order to build successfully.

Or try to fix the issue in current project.
Android Studio does not sign the code for debug build - Stack Overflow
 
Is your project an old one? It seems to show a lack of signing configuration for your project.

Android Studio automatically stores your debug signing information in a signing configuration so you do not have to enter it every time you debug. A signing configuration is an object consisting of all of the necessary information to sign your app, including the keystore location, keystore password, key name, and key password.

So, create a new project and then copy all your codes into it in order to build successfully.

Or try to fix the issue in current project.
Android Studio does not sign the code for debug build - Stack Overflow
I fixed the error message but the problem is, it doesn't have my app in emulator
 
Have you imported the design library into your project? It looks like you're missing a reference in your build.gradle


compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
 
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'

Where can I write this code? I'm in build.gradle (module: Second app.app)

plugins {
id 'com.android.application'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.example.secondapp"
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_6
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
 
Back
Top Bottom