Anyone know how to import android support to AIDE compiler app
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With