1

I'm trying to run the very first NativeScript app HelloWorld that I have got from examples and I receive the message:

AAPT: error: style attribute 'android:attr/forceDarkAllowed' not found.

The screenshot of error message

5
  • Can you try updating the android sdk to the latest one? Commented Nov 13, 2019 at 12:50
  • I just download and install the latest version of Android SDK. No changes. Still error message. Commented Nov 13, 2019 at 18:24
  • Have you installed Android Q / API level 29 and it's build tools, compiling with same? Are you using latest CLI? Commented Nov 13, 2019 at 20:18
  • $ tns --version 6.2.0 Commented Nov 13, 2019 at 20:27
  • It's work now. Was something wrong with Android SDK. I delete and reinstall it, check and change the path to SDK, and finally, the emulator started. I think that case was because of PATH in env was differ than in Android SDK settings. Commented Nov 14, 2019 at 14:53

2 Answers 2

8

inside App_Resources/Android/src/app.gradle

add "compileSdkVersion 29" above defaultConfig { }

will look like this :

android {
  compileSdkVersion 29
  defaultConfig {
    minSdkVersion 17
    generatedDensities = []
  }
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! The problem was because the emulator didsn't start. And it didn't start becuase PATH in env was c:\android\sdk, but PATH in Android Studio was c:\users\....\AppData\....
0

The problem was because the emulator didsn't start. And it didn't start becuase PATH in env was c:\android\sdk, but PATH in Android Studio was c:\users....\AppData....

The problem was solved by specifying the correct path to the SDK in Android Studio.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.