1. Are you ready for the Galaxy S20? Here is everything we know so far!

I have few problems with android studio

Discussion in 'Android Development' started by Mohamed13, Jan 9, 2021.

  1. Mohamed13

    Mohamed13 Lurker
    Thread Starter

    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
     


    #1 Mohamed13, Jan 9, 2021
    Last edited: Jan 10, 2021

    1. Download the Forums for Android™ app!


      Download

       
  2. James_Watson

    James_Watson Android Enthusiast

    Why not to start your app in debugging mode on an emulator and then do step-by-step debug?
     
  3. Mohamed13

    Mohamed13 Lurker
    Thread Starter

    It will be the same and have a error message.
    upload_2021-1-10_14-46-40.png
     

    Attached Files:

  4. James_Watson

    James_Watson Android Enthusiast

    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
     
  5. Mohamed13

    Mohamed13 Lurker
    Thread Starter

    I fixed the error message but the problem is, it doesn't have my app in emulator
     
  6. apurvadesai03

    apurvadesai03 Lurker

    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'
     
  7. Mohamed13

    Mohamed13 Lurker
    Thread Starter

    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'
    }
     
Loading...

Share This Page

Loading...