Sama ternyata
Solved error with AppCompat 27
hehe… btw ane saat ini pake appcompat 27 fc mulu… tapi kalo pake 26.0.0-apha baru bisa
Punya ane normal aja gan?
Vicky ente org mna? Ane juga sama orang indonesia
Hello! Thank you for this hint.
I tried but I get an error that prevent me to even try whether it will work or not. The erri error is here in the picture below.
It is seems that you used ‘.’ insteed of ‘:’
Yeah I understood that and I have already solved it, there no error highlighted, but unfortunately the app crashes.
I succeeded with the instruction except adding ‘google()’ to repositories.
To recover, after removing ‘google()’ from repositories, I should also remove ‘build’ directory and refresh maven repository and even uninstall my test app. Althogth I dont know which is mandatory.
How bro ? I am facing the same problem !
Remove build directory ?
Which is that ?
inside your app directory.
It is important that, there are two style.xml files, in ‘values’ and ‘values-v21’. Both of files should be fixed.
I spent couple of hours to remember this.
Let you see the whole code!
First build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:1.+’
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCenteral()
}
}
Second build.gradle
apply plugin: ‘com.android.application’
android {
compileSdkVersion 27
buildToolsVersion “27.+”
defaultConfig {
applicationId "com.mycompany.myapp"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api (‘android.arch.core:runtime:+’)
{
force = true
}
api ‘com.android.support:appcompat-v7:27.+’
api fileTree(dir: ‘libs’, include: [’*.jar’])
}
MainActivity.java
package com.mycompany.myapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
res/layout/main.xml
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
res/values/styles.xml
AND (are the same)
res/values-v21/styles.xml
<?xml version="1.0" encoding="utf-8"?>No error been highlighted but yet the app crashes. Where I missed ?
Thanks
this is my try.
This correction is missed.
classpath ‘com.android.tools.build:gradle:3.+’
It is not mandatory.
I almost give up! Do you know why?
I copied your Github example without any modification, yeah there is no any error highlighted and even the lodget is cleared, meaning there is no any problem. But unfortunately the app yet crashes.
I don’t know whether the case is relating to my own device.
I am using itel it1409 version 5.1
Can you see LogCat? That should be very helpful.
You can see logcat in AIDE, but standalone logcat viewer is better. Normally seeing log not allowed, so you need rooted devices, or to grant permission manually by adb, external device (PC) is required.
This is the command to grant access log to AIDE.
adb shell pm grant com.aide.ui android.permission.READ_LOGS
So what basically causes this problem? Why shouldn’t AIDE provide a proper and easy way?
Another thing to bear in mind. After changing the build gradle file, it is always good to refresh the libraries from the Settings and rebuild the project.
It worked in my case (finally).