Run react-native info in your project and share the content.
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 38.84 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.2.0 - ~/.nvm/versions/node/v11.2.0/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v11.2.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.8 => 0.59.8
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-gesture-handler: 1.2.1
react-native-git-upgrade: 0.2.7
What react-native-splash-screen version are you using?
3.1.1
What platform does your issue occur on? (Android/iOS/Both)
Describe your issue as precisely as possible :
1) Steps to reproduce the issue or to explain in which case you get the issue
2) Interesting logs
There is a build error when building the library with Android SDK 28.
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
Build error
> Task :react-native-splash-screen:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-splash-screen:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/navalsaini/hf/android/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/navalsaini/hf/android/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/navalsaini/hf/android/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values/values.xml:2727: error: resource android:attr/fontVariationSettings not found.
/Users/navalsaini/hf/android/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values/values.xml:2728: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Seems like dialogCornerRadius, fontVariationSettings and ttcIndex are remobetween android sdk 26 and 28.
Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?
(We can close this issue)
It went away in version
I can see that following was added to build.gradle in the code.
def supportLibVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION
...
implementation "com.android.support:appcompat-v7:$supportLibVersion"
I believe this fixed my issue.
I'm having same issue while creating release APK for android. My Configuration are as below,
"react": "16.8.6",
"react-native": "^0.59.4",
"react-native-splash-screen": "^3.2.0",
While executing command ./gradlew assembleRelease having error as below for task react-native-splash-screen:verifyReleaseResources
> Task :react-native-splash-screen:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-splash-screen:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/sunflowermacmini/Documents/Purvik/SFL-Projects/LegacyLink/reactlegacylink/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/sunflowermacmini/Documents/Purvik/SFL-Projects/LegacyLink/reactlegacylink/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/sunflowermacmini/Documents/Purvik/SFL-Projects/LegacyLink/reactlegacylink/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values/values.xml:2727: error: resource android:attr/fontVariationSettings not found.
/Users/sunflowermacmini/Documents/Purvik/SFL-Projects/LegacyLink/reactlegacylink/node_modules/react-native-splash-screen/android/build/intermediates/res/merged/release/values/values.xml:2728: error: resource android:attr/ttcIndex not found.
error: failed linking references.
You have closed this issue as described above and I've that same code already in build.gradle file of react-native-splash-screen but although not having effect of it.
Having trouble, If any one has any solution then they can suggest.
Solved
well, I updated my android/build.gradlew to have version as below, and it works.
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
Try running it with
./gradlew app:assembleRelease instead of ./gradlew assembleRelease
Try running it with
./gradlew app:assembleReleaseinstead of./gradlew assembleRelease
Its work for me. Thanks!
Try running it with
./gradlew app:assembleReleaseinstead of./gradlew assembleRelease
apk was generated but cannot install to the devices. Can anyone explain me why is that?
Try running it with
./gradlew app:assembleReleaseinstead of./gradlew assembleRelease
what's the difference?
Try running it with
./gradlew app:assembleReleaseinstead of./gradlew assembleReleasewhat's the difference?
any explication?
I am using 3.0.6 and same error appears
{
"react-native-splash-screen": "3.0.6",
}
After some searching I found a solution, just inserted some code of lines in myApp android/build.gradle
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
That worked but I also tried the one @Purvik told,
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
....
}
That worked too!
Most helpful comment
Try running it with
./gradlew app:assembleReleaseinstead of./gradlew assembleRelease