I'm having trouble with the react-native-splash-screen
React-native info
Node : 16.17.0
Yarn : 1.22.19
react : 18.1.0
react-native : 0.70.0
Error
MainActivityDelegate cannot be converted to Activity SplashScreen.show(this);
MainActivity.java
`
package com.ala.com.ala;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.lockincomp.liappagent.LiappAgent;
import org.devio.rn.splashscreen.SplashScreen;
#Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
...my other codes
super.onCreate(null);
// super.onCreate(savedInstanceState); <- this also tried but not working
}
`
I don't know why I'm having this kind of error. because of React Native 0.7 version error? or what...please help..
I also tried to use react-native-bootsplash but this library also having error in
`#Override
protected void onCreate(Bundle savedInstanceState) {
RNBootSplash.init(this); //this part having error in this
super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
}`
#Override
protected void onCreate(Bundle savedInstanceState) {
...my other codes
super.onCreate(null);
//super.onCreate(savedInstanceState); <- this also tried but not working
SplashScreen.show(this);
}
try this, also remove other manual configuration from setting.gradle and app/build.gradle file for splash screen. Hope this will work.
If you guys have same issue on RN ver. 0.7 by using the react-native-splash-screen, please check this
https://github.com/crazycodeboy/react-native-splash-screen/issues/591#issue-1424947030
I fixed my issue
Related
I've been trying to write some tests for my Ktor application, and have followed the docs here:
https://ktor.io/docs/testing.html#end-to-end
...and using a test setup like this:
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.testing.*
import kotlin.test.*
class ApplicationTest {
#Test
fun testRoot() = testApplication {
val response = client.get("/")
assertEquals(HttpStatusCode.OK, response.status)
assertEquals("Hello, world!", response.bodyAsText())
}
}
The problem is that when using testApplication in every test, is that the tests crashes when I have around 220 tests that should be run, because my application reads a json-file for every boot - resulting in a "too many open files" error.
What I want to do is run the application once, then send all my HTTP-requests to this single instance of the application, and then close the application.
What is instead happening above is that the application is booted and closed for each one of the over 200 tests, resulting in memory errors.
How do I run the application only once?
Solved it!
We can start the application in a beforeAll function, instead of starting it in every test. Here's an example of how to do that:
import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.server.testing.*
import io.ktor.test.dispatcher.*
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
class MyApiTest {
lateinit var JSON: Json
#Test
fun `Test some endpoint`() = testSuspend {
testApp.client.get("/something").apply {
val actual = JSON.decodeFromString<SomeType>(bodyAsText())
assertEquals(expected, actual)
}
}
companion object {
lateinit var testApp: TestApplication
#JvmStatic
#BeforeAll
fun setup() {
testApp = TestApplication { }
}
#JvmStatic
#AfterAll
fun teardown() {
testApp.stop()
}
}
}
I am using viewmodel in jetpack compose and build a factory like
import android.content.Context
import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
internal class MyStateBuilder(val args: Map<String, Any?>?, val context: Context) :
ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
try {
Log.d("ppx",modelClass.constructors.size.toString())
modelClass.constructors.forEach {
Log.d("ppx",it.toGenericString())
}
modelClass.getConstructor(Map::class.java, Context::class.java)
return modelClass.getConstructor(Map::class.java, Context::class.java)
.newInstance(args, context)
}catch (e:Exception){
Log.e("ppx","start")
e.printStackTrace()
throw IllegalArgumentException()
}
}
}
these codes works fine at debug compile mode, but when I goto release compile, constructor of provided class suddenly go 0 and viewModel cannot be initialized, does anybody know what happened at compile transmission?
Problem:
I'm trying to recreate this codelab tutorial project https://developer.android.com/codelabs/android-proto-datastore, but Android Studio can't import androidx.datastore.dataStore
Steps:
create new Kotlin project with an empty Acivity
modify gradle file
Switch to Android Studio's Project view
create a folder named proto inside of app/src/main
create and modify file user_prefs.proto inside of app/src/main/proto
Build -> Clean Project -> rebuild project
Create a serializer class called UserPreferencesSerializer
Trying to add the following Code to the empty MainActivity.kt
private const val DATA_STORE_FILE_NAME = "user_prefs.pb"
private val Context.userPreferencesStore: DataStore
by dataStore(
fileName = DATA_STORE_FILE_NAME,
serializer = UserPreferencesSerializer )
After this step Android Studio marks dataStore and shows the warning "Unresolved reference: dataStore" I'm also unable to import androidx.datastore.dataStore, but I can't find a missing import in my gradle file. Please, can someone tell me how I can resolve this problem?
Code:
build.gradle
plugins {
id 'com.android.application'
id 'kotlin-android'
id "com.google.protobuf" version "0.8.12"
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "androidx.datastore:datastore-core:1.0.0-alpha08"
implementation "com.google.protobuf:protobuf-javalite:3.11.0"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.10.0"
}
// Generates the java Protobuf-lite code for the Protobufs in this project. See
// https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
// for more information.
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option 'lite'
}
}
}
}
}
user_prefs.proto
syntax = "proto3";
option java_package = "com.example.test";
option java_multiple_files = true;
message UserPreferences {
// filter for showing / hiding completed tasks
bool show_completed = 1;
}
UserPreferencesSerializer
package com.example.test
import androidx.datastore.core.CorruptionException
import androidx.datastore.core.Serializer
import com.google.protobuf.InvalidProtocolBufferException
import java.io.InputStream
import java.io.OutputStream
object UserPreferencesSerializer : Serializer<UserPreferences> {
override val defaultValue: UserPreferences = UserPreferences.getDefaultInstance()
override suspend fun readFrom(input: InputStream): UserPreferences {
try {
return UserPreferences.parseFrom(input)
} catch (exception: InvalidProtocolBufferException) {
throw CorruptionException("Cannot read proto.", exception)
}
}
override suspend fun writeTo(t: UserPreferences, output: OutputStream) = t.writeTo(output)
}
MainActivity.kt
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.datastore.core.DataStore
private const val DATA_STORE_FILE_NAME = "user_prefs.pb"
private val Context.userPreferencesStore: DataStore<UserPreferences> by dataStore(
fileName = DATA_STORE_FILE_NAME,
serializer = UserPreferencesSerializer
)
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
I also had this problem while working on a project.
I found that I was using datastore-core and needed datastore-preferences. So I changed my dependency declaration from:
implementation 'androidx.datastore:datastore-core:1.0.0-alpha08'
to:
implementation 'androidx.datastore:datastore-preferences:1.0.0'
Possibly there was a breaking change between alpha08 and the 1.0.0 release.
The dataStore delegate is part of the androidx.datastore:datastore library.
Add the dependency to your modudle's build.gradle file. Replace $dataStoreVersion with the version of data store which you use, e.g. 1.0.0:
implementation "androidx.datastore:datastore:$dataStoreVersion"
You can find the available versions here in Google's Maven repository.
After adding this dependency, you can use by dataStore by adding the following import to your class:
import androidx.datastore.dataStore
In Android documentation:
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")
This line should be at the top of your code.
See DataStore documenation
After a lot of searching, The problem is simple. Make sure Gradle is not in offline mode.
Also, ensure that you use this dependency.
implementation "androidx.datastore:datastore-preferences:$dataStoreVersion"
I switched from react native navigation v1 to v2 and I have theses 5 errors when trying to sync my files with Android Studio.
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve project :react-native-navigation.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve project :react-native-navigation.
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve project :react-native-navigation.
Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve project :react-native-navigation.
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve project :react-native-navigation.
I tried to clear .iml files and .idea folder, invalidate caches and restart.
Configuration:
react-native: 0.51.0,
react-native-navigation: ^2.4.0,
Android Studio: 3.1.1
Android build.gradle
buildscript {
repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url 'https://jitpack.io' }
jcenter()
}
}
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 19
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.1.0"
}
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("reactNative55") || names.contains("reactNative56") || names.contains("reactNative57")) {
setIgnore(true)
}
}
}
}
}
}
App build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.myapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative51"
multiDexEnabled true
versionCode 723
versionName "1.72"
ndk {
abiFilters "armeabi-v7a", "x86"
}
versionNameSuffix '3'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
productFlavors {
}
}
dependencies {
compile project(':react-native-appsflyer')
compile project(':react-native-text-input-reset')
compile project(':bugsnag-react-native')
compile project(':react-native-version-check')
compile project(':react-native-video')
compile project(':react-native-intercom')
compile project(':react-native-fast-image')
compile project(':react-native-device-info')
compile project(':react-native-rate')
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-fbsdk')
compile project(':react-native-linear-gradient')
implementation fileTree(dir: "libs", include: ["*.jar"])
compile 'com.facebook.android:facebook-android-sdk:4.29.0'
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
// From node_modules
compile 'com.facebook.fresco:animated-gif:1.3.0'
implementation project(':react-native-navigation')
// Firebase dependencies
compile 'com.google.android.gms:play-services-base:11.6.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.firebase:firebase-firestore:11.6.0'
compile(project(':react-native-maps')) {
exclude group: 'com.google.android.gms'
}
compile('com.google.android.gms:play-services-base:11.6.0') {
force = true;
}
compile('com.google.android.gms:play-services-maps:11.6.0') {
force = true;
}
compile('com.google.android.gms:play-services-gcm:11.6.0') {
force = true;
}
implementation "com.google.firebase:firebase-analytics:11.6.0"
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation project(':react-native-fbsdk')
implementation "com.google.firebase:firebase-messaging:11.6.0"
implementation 'me.leolin:ShortcutBadger:1.1.21#aar'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
MainActivity.java
package com.myapp;
import com.reactnativenavigation.NavigationActivity;
import android.content.Intent;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerConversionListener;
public class MainActivity extends NavigationActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
// #Override
// protected String getMainComponentName() {
// return "MyApp";
// }
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
}
}
MainApplication.java
package com.myapp;
import com.BV.LinearGradient.LinearGradientPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
// import com.facebook.react.shell.MainReactPackage;
// import com.facebook.soloader.SoLoader;
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.reactnativenavigation.react.ReactGateway;
import com.nikolaiwarner.RNTextInputReset.RNTextInputResetPackage;
import com.reactlibrary.RNRatePackage;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import com.facebook.appevents.AppEventsLogger;
import com.airbnb.android.react.maps.MapsPackage;
import io.xogus.reactnative.versioncheck.RNVersionCheckPackage;
import com.bugsnag.BugsnagReactNative;
import com.brentvatne.react.ReactVideoPackage;
import com.dylanvann.fastimage.FastImageViewPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.robinpowered.react.Intercom.IntercomPackage;
import io.intercom.android.sdk.Intercom;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.app.Activity;
// import com.reactnativenavigation.controllers.ActivityCallbacks;
// import com.facebook.react.ReactApplication;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nullable;
import com.appsflyer.reactnative.RNAppsFlyerPackage;
public class MainApplication extends NavigationApplication {
private static CallbackManager mCallbackManager = CallbackManager.Factory.create();
protected static CallbackManager getCallbackManager() {
return mCallbackManager;
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
#Override
protected ReactGateway createReactGateway() {
ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
#Override
protected String getJSMainModuleName() {
return "index";
}
};
return new ReactGateway(this, isDebug(), host);
}
#Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
#Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
// new MainReactPackage(),
new RNAppsFlyerPackage(MainApplication.this),
new RNTextInputResetPackage(),
BugsnagReactNative.getPackage(),
new RNVersionCheckPackage(),
new ReactVideoPackage(),
new IntercomPackage(),
new FastImageViewPackage(),
new RNDeviceInfo(),
new RNRatePackage(),
new RNFirebasePackage(),
new RNFirebaseMessagingPackage(),
new FBSDKPackage(mCallbackManager),
new LinearGradientPackage(),
);
}
#Override
protected String getJSMainModuleName() {
return "index";
}
};
#Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
#Override
public void onCreate() {
super.onCreate();
AppEventsLogger.activateApp(this);
Intercom.initialize(this, "android_sdk-mykey", "mykey");
BugsnagReactNative.start(this);
setActivityCallbacks(new ActivityCallbacks() {
#Override
public void onActivityResumed(Activity activity) {
// Do stuff
}
#Override
public void onActivityPaused(Activity activity) {
// Do stuff
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mCallbackManager.onActivityResult(requestCode, resultCode, data);
}
});
FacebookSdk.sdkInitialize(getApplicationContext());
SoLoader.init(this, /* native exopackage */ false);
}
#Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
#Nullable
#Override
public List<ReactPackage> createAdditionalReactPackages() {
return Arrays.<ReactPackage>asList(
new RNTextInputResetPackage(),
// new MainReactPackage(),
BugsnagReactNative.getPackage(),
new RNVersionCheckPackage(),
new RNRatePackage(),
new RNFirebasePackage(),
new RNFirebaseAuthPackage(),
new RNFirebaseFirestorePackage(),
new RNFirebaseAnalyticsPackage(),
new RNFirebaseMessagingPackage(),
// new RNFirebaseNotificationsPackage(),
new RNDeviceInfo(),
new ReactVideoPackage(),
new IntercomPackage(),
new FastImageViewPackage(),
new MapsPackage(),
new FBSDKPackage(mCallbackManager),
new LinearGradientPackage(),
new RNAppsFlyerPackage(MainApplication.this)
);
}}
My settings.gradle
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android')
And gradle-wraper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Sorry for the long code but I maybe made a mistake somewhere.
It looks like the RNN module is not present.
Quick checklist to resolve this:
1) Check package.json, it should contain in its dependencies "react-native-navigation": "^2.11.0", or another similar version. If it does not, the module will need to be (re-)installed. Use npm install --save react-native-navigation, or yarn equivalent.
2) Check inside the directory ./node_modules/react-native-navigation. If it only contains 'lib/android/app/<single file>', your module may have been deleted. If so, npm install / yarn install should recover it.
Im using udacity to learn android development and I have ran into a problem. there are a few errors that have come up:
error: package android.v7.app does not exist
error: cannot find symbol class AppCompatActivity
error: method does not override or implement a method from a supertype
error: cannot find symbol variable super
error: cannot find symbol method setContentView(int)
error: cannot find symbol class openNumbersList
error: cannot find symbol method startActivity(Intent)
Everything was working fine but I was following a tutorial and noticed that my imports in my Main Activity didn't match with what was on the tutorial so I changed:
import...
to
import android.v7.app.AppCompatActivity;
import android.os.Bundle;
also even before this, AppCompatActivity was in red:
Main Activity:
package com.example.android.miwok;
import android.content.Intent;
import android.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the content of the activity to use the activity_main.xml layout file
setContentView(R.layout.activity_main);
}
public void openNumbersList(View view){
Intent i = new Intent(this, openNumbersList.class);
startActivity(i);
}
}
gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.android.miwok"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:23.3.0'
implementation 'com.android.support:support-v4:23.3.0'
implementation 'com.android.support:design:23.3.0'
}
hope this helps.
I assume, that you forget to add the dependency to the appcompat support library. Add this to your build.gradle in the app folder:
dependencies {
...
// Add this line
implementation 'artifact com.android.support:appcompat-v7:28.0.0-alpha1'
}
However, you should read other tutorials as well because you will proably face more issues, when you don't know how dependencies work in Android. If you create a fresh project in Android Studio, it will create a runnable app for you which is a good point to start off.
EDIT
I re-read your code and the import is incorrect. It must be
android.support.v7.app.AppCompatActivity
instead of
android.v7.app.AppCompatActivity