1

I'm an android learner. I have a doubt can anyone please resolve my errors. I build a normal news story app. In the android studio, I built an app 100% working fine without errors and all app functionalities are working well. Then after I'm generating build apk to check on real devices. after installing build apk, it's working very well on real devices.

After generating signed apk and installed on a real device. it is not showing category images on signed apk. but category images are coming in build apk.

i don't know why category images are not showing in signed apk. i cannot understand why it will not come.

Backend using PHP for admin panel...

See The Difference in images...

Build apk showing category images please check image 1

signed apk not showing category images please check image 2

build.gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId 'com.example.demo'
        minSdkVersion 14
        targetSdkVersion 27
        versionCode 1
        versionName "1.0.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:21.0.3'
    implementation 'com.google.android.gms:play-services:6.5.87'
    implementation 'com.android.support:recyclerview-v7:21.+'

}

proguard-rules.pro:

   # Add project specific ProGuard rules here.
    # By default, the flags in this file are appended to flags specified
    # in G:\Programs\SDK\tools\proguard/proguard-android.txt
    # You can edit the include path and order by changing the proguardFiles
    # directive in build.gradle.
    #
    # For more details, see
    #   http://developer.android.com/guide/developing/tools/proguard.html

    # Add any project specific keep options here:

    # If your project uses WebView with JS, uncomment the following
    # and specify the fully qualified class name to the JavaScript interface
    # class:
    #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
    #   public *;
    #}
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108

1 Answers1

0

Update:

Gradle build success but build failed with 53errors.. java compilation errors... one of the error mention here.. error: cannot find symbol class ActionBarActivity 'import android.support.v7.app.ActionBarActivity;',private ActionBarActivity activity;

Gradle is working now. The issue is coming from ActionBarActivity. Use AppCompatActivity in your class and getSupportActionbar() inside your onCreate() method.


I strongly recommend using latest version for these:

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0' // must have the same version with the appcompat
implementation 'com.google.android.gms:play-services:12.0.1'

And you have used 21.+ for the RecyclerView and 21.0.3 for the AppCompat. Use the same version. Perhaps using 21.+ for the RecyclerView might cause the issue.

Check the latest version for the Google Play Services with this link.

Note that you'll also need to define compileSdkVersion and etc as follows:

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 28
      ...

And also, in the root Build.gradle, update the gradle:

classpath 'com.android.tools.build:gradle:3.2.0'
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • thank you for sharing I'm just updating with your suggestions lets see what will happen @monsen – Telugu Tech Library Oct 01 '18 at 07:07
  • Targeted sdkversion should be the same version as the compileSdkVersion. That might cause the issue too so, I've added mine `Build.gradle` you just need to upgrade them. I hope this would wok. :) – ʍѳђઽ૯ท Oct 01 '18 at 07:10
  • showing this gradle sync error message Minimum supported Gradle version is 4.6. Current version is 4.4. Please fix the project's Gradle settings. Fix Gradle wrapper and re-import project Gradle settings – Telugu Tech Library Oct 01 '18 at 07:19
  • Here explains it well: https://stackoverflow.com/questions/43077386/gradle-error-minimum-supported-gradle-version-is-3-3-current-version-is-3-2 you'll probably need to chnage the current version to **4.6** – ʍѳђઽ૯ท Oct 01 '18 at 07:22
  • yes just i updating to 4.6 version lets see what happen... thank you so much for your support here. @monsen – Telugu Tech Library Oct 01 '18 at 07:28
  • '*Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed* Output: E:\Android\August\AndroidProjects\demo\app\src\main\res\menu\menu_search.xml:5: error: resource drawable/abc_ic_search_api_mtrl_alpha (aka com.example.demo:drawable/abc_ic_search_api_mtrl_alpha) not found. E:\Android\August\AndroidProjects\demo\app\src\main\res\menu\search.xml:5: error: resource drawable/abc_ic_search_api_mtrl_alpha (aka com.example.demo:drawable/abc_ic_search_api_mtrl_alpha) not found. error: failed linking file resources.' – Telugu Tech Library Oct 01 '18 at 07:39
  • Couldn’t find this file: drawable/abc_ic_search_api_mtrl_alpha. Remove it or change it. so it seems like gradle worked ;) – ʍѳђઽ૯ท Oct 01 '18 at 07:40
  • after change drawable/abc_ic_search_api_mtrl_alpha.. Gradle build success but build failed with 53errors.. java compilation errors... one of the error mention here.. error: cannot find symbol class ActionBarActivity 'import android.support.v7.app.ActionBarActivity;',private ActionBarActivity activity; – Telugu Tech Library Oct 01 '18 at 08:06
  • @TeluguTechLibrary Updated the answer. – ʍѳђઽ૯ท Oct 01 '18 at 08:31
  • After the change to AppCompatActivity, no errors build success but after launch activity app doesn't open. can anyone explain? – Telugu Tech Library Oct 01 '18 at 12:28
  • app not opened and throws error stopped working message – Telugu Tech Library Oct 01 '18 at 12:35
  • If it crashes and says stopped working so there might be some logcats of the error or anything. Please use **Ask question** for the new questions and put the logcat to the question and send me the link. If gradle issue solved and my answer helped, please consider marking it as accepted. – ʍѳђઽ૯ท Oct 01 '18 at 12:44
  • Thank you for your help but why it is not open app after run on android studio launch activity not open the app? – Telugu Tech Library Oct 01 '18 at 12:58
  • I can't help you without checking your codes or the logcat. Would you please create a new question and send the link for me? I need to see how you wrote your codes and what is in the logcat. Thanks – ʍѳђઽ૯ท Oct 01 '18 at 13:00