Android Layout Unable to see app Preview - android

I am not able to see the preview in the Android layout like the toolbar or the ActionBar. Below is the screenshot of the app:
Thanks.

Check if you are using SDK 28 as SDK 28 has a bug. Change
compileSdkVersion 28
targetSdkVersion 28
to
compileSdkVersion 27
targetSdkVersion 27
and use this in build.gradle:
implementation 'com.android.support:appcompat-v7:27.1.1'
If you're not using SDK 28, you can try Build -> Clean Project or restart Android Studio.

Related

problem in my first project of android studio

When I was creating a new project it showed this warning and I do not understand what is it for.
This is the image of the warning it is showing.image
I changed to 31 and here are some screenshots regarding the issue.
Try changing the compileSdk to 31 instead of 32 in your build.gradle.
change your compileSdkVersion and targetSdkVersion in build.gradel file
compileSdkVersion 31
targetSdkVersion 31

Adding React-Native-Admob in React-Native

I am trying to add React-Native-Admob 2.0.0-beta.5 into React-Native v0.55.4 for Android.
compileSdkVersion =26
buildToolsVersion ="27.0.3"
targetSdkVersion = 26
supportLibVersion = "26.1.0"
minSdkVersion = 18
And React-Native-Admob has
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
}
And when i Compile the error Exception occur
The SDK Build Tools revision (23.0.1) is too low for project ':react-native-admob'. Minimum required is 25.0.0
I can't downgrade my project's SDK, other package uses that SDK.
You don't need to downgrade, you need to upgrade. Dependencies were probably added in the SDK that admob relies on. You can download the specified version packages for the SDK through Android studio and then set your SDK version in the file to the appropriate version necessary for admob.
Edit
I see that you are saying that admob is using version 23. You may need to submit an issue with them on GitHub for this.
you can change the buildToolVersion of the library you are using, just go to -> node_modules/{your-library}/android/build.gradle, change buildToolsVersion from 23.0.1 to 25.0.0.
if the studio asks for any updates regarding build, just update it, and it might work.
another solution:
although I haven't tried it, it has a lot of emoji love on GitHub,
https://github.com/oblador/react-native-keychain/issues/68#issuecomment-304836725
Goto
"node-module/react-native-admob/android/build.gradle" file, then change the compileSdkVersion and buildToolsVersion to following values
compileSdkVersion 27
buildToolsVersion "27.0.3"

Why I can't use low version buildTools?

When I use 25.0.0, my project appear some bug(Floating Action Button doesn't show). But I can choice low version.
Error:The SDK Build Tools revision (24.0.3) is too low for project ':app'. Minimum required is 25.0.0
change classpath 'com.android.tools.build:gradle:+' to classpath 'com.android.tools.build:gradle:2.2.2' , and now ,I can use 24.0.3
I would guess that you have a build.gradle file that defines buildToolsVersion "25.0.0". But you only have version 24.0.3 installed.
Either upgrade your build tools by installing a newer version using Tools/Android/SDK Manager/SDK Tools or change the requirements on the app's build.gradle file to require the version you seem to have (24.0.3).
Make sure your compileSdkVersion does not overlap with your buildToolsVersion.
What I do in my project is I match the compileSdkVersion and buildToolsVersion. Looks like this.
compileSdkVersion 24
buildToolsVersion '24.0.2'
defaultConfig {
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
Also, you can always check for updates from the SDK Manager in Android Studio.
Please take a look at this also,
What is the buildToolsVersion for android SDK 24?
Cheers!

Gradle project sync failed android studio

I downloaded Arc library form github and imported it as module then I got this error.
Error:Cause: failed to find target with hash string 'android-4' in: C:\Users\shahek\AppData\Local\Android\sdk
Open Android SDK Manager
I also installed Api 15.
This is my build.gradle setting.
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.shahek.myapplication"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
You must install version 23 and all this things must be solved.
If it don't help you,
try to download this library from github and add into project and modify min sdk version in gradle/manifest to yours 18.
Good luck.

Error in Android studio New Application

Whenever i start new application in android studio this error pop ups
what should i do
It seems that is because your Compile SDK version is below 23.
Make compileSdkVersion 23 in your buiild.gradle file and rebuild your project.
You should use compileSdkVersion 23 in your build.gradle.
First make sure that you set
compileSdkVersion 23
buildToolsVersion "23.0.1"
and
targetSdkVersion 23
Then Clean-Rebuild-Gradle .
Try this way .I hope it works .

Categories

Resources