Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import android.support.v7.* (appcompat) to AIDE

Anyone know how to import android support to AIDE compiler app

like image 438
user8853889 Avatar asked Oct 25 '25 17:10

user8853889


1 Answers

After a lot of time spent searching and with the help of Alan Downie ( Cudos to you! ) here is the instructions to use AppCompatActivity with version 27.+ of the support library. It is important to use the latest support libraries as older libraries have bugs which are fixed in later versions. Ok here goes.

1.Create a new project in AIDE.

2.Add the com.android.support:appcompat-v7:27.+ support library. ( Using the 'Add to Project' option available in your project folder within the Aide app.) 3.Change the following items in your build.gradle file, which is also available in your project folder.

compileSdkVersion 27
buildToolsVersion "27.+"

add the following to you dependencies section.

compile ('android.arch.core:runtime:+') {
       force = true
}   

The above is needed as there is an issue with Aide and AppCompatActivity not loading all the required libraries. This will be fixed soon hopefully.

4.Go to your res/values folder and click on styles.xml and change the following.

Change

<style name="AppTheme" parent="@android:style/Theme.Holo.Light">

To

<style name="AppTheme" parent="Theme.AppCompat.Light">

5.Do the same as 4 to your res/values-v21 folder. (Important!)

6.Just to be clear, below is what your build.gradle file should look like for a basic out of the box working Aide project using the latest supported support libraries. I hope you find this post useful.

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "27.+"

defaultConfig {
    applicationId "com.your.appname"
    minSdkVersion 14
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {

compile ('android.arch.core:runtime:+') {
       force = true
       } 

compile 'com.android.support:appcompat-v7:27.+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}

PS. Don't forget to change the extends Activity to extends AppCompatActivity in your MainActivity.java file and don't copy and paste the above, change the values in your existing build.gradle file instead.

like image 144
Cymro Avatar answered Oct 28 '25 07:10

Cymro