remobile / react-native-toast

A android like toast for android and ios, android use native toast, ios use UIView+Toast
MIT License
346 stars 143 forks source link

Does not compile for release on android with RN 0.57 #51

Open mieszko4 opened 5 years ago

mieszko4 commented 5 years ago

When I compile this with new RN 0.57 I get the following errors:

The project name '@remobile/react-native-toast' contains at least one of the following characters: [ , /, \, :, <, >, ", ?, *, |]. This has been deprecated and is scheduled to be removed in Gradle 5.0. Set the 'rootProject.name' or adjust the 'include' statement (see https://docs.gradle.org/4.4/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[]) for more details).

> Configure project :@remobile/react-native-toast 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.4.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

and

error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.

/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.

/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values-v26/values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.

/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.

/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/font not found.

/home/mieszko4/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/2894229df102aba6e62f0ed03c56206b/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.

error: failed linking references.

This happens when I run for release (for debug it works ok) I am using com.android.tools.build:gradle:3.1.4 As a workaround the following helps:

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}
yellowpig commented 5 years ago

I change the compileSdkVersion buildToolsVersion targetSdkVersion in './node_modules/@remobile/react-native-toast/android/build.gradle' to my project's version. Solved this problem temporarily.

mieszko4 commented 5 years ago

@fov42550564 Is this project dead? I see lots of prs with potential fix for this issue.

ibedwi commented 5 years ago

I change the compileSdkVersion buildToolsVersion targetSdkVersion in './node_modules/@remobile/react-native-toast/android/build.gradle' to my project's version. Solved this problem temporarily.

This works for me. Thanks!