Open Amansaxena001 opened 2 years ago
Task :rn-scratch-card:compileReleaseKotlin FAILED w: Runtime JAR files in the classpath have the version 1.3, which is older than the API version 1.5. Consider using the runtime of version 1.5, or pass '-api-version 1.3' explicitly to restrict the available APIs to the runtime of version 1.3. You can also pass '-language-version 1.3' instead, which will restrict not only the APIs to the specified version, but also the language features w: /Users/amansaxena/.gradle/caches/transforms-2/files-2.1/4500bbafdf53dca4f4031af27b416665/jetified-kotlin-stdlib-
@avegrv try building the android app , ios builds are successfully but android there is some issue
Facing the same issue here
@Amansaxena001 seems like the issue is the React Native version. This was introduced in 0.65.0 (commit https://github.com/facebook/react-native/commit/2fbbdbb2ce897e8da3f471b08b93f167d566db1d), and I had an earlier RN version. You can try upgrading it as well.
@avegrv @gurshansingh Even after following the process, though the issue of kotlin is resolved but there is no interaction with the scratch cards , it is just placed like an image.
@Swarnim01 Share your code please
@avegrv Resolved it , Placing it under <SafeAreaView>
was causing trouble
how to apply to expo project
Closed this one. The solution you can find here https://github.com/sweatco/rn-scratch-card/issues/9 Later will do the fix.
@avegrv is it possible to push the fix for this?
Hi, I'm still facing this issue with the below versions:
buildToolsVersion = "30.0.3" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31
"react-native": "~0.63.4" "rn-scratch-card": "^1.1.0"
@zilinailee can you try with the mentioned steps
@zilinailee can you try with the mentioned steps
- go to rn-scratch-card in node_modules
- open build.gradle and change minSdkVersion 22 to 21
- Then open gradle.properties and change RnScratchCard_kotlinVersion to your root project's kotlin version (to find kotlin version, go to android folder use ./gradlew -v for version )
I had alrd tried this but I still get error
@zilinailee what i can see your build failed for app:installUatDebug which is the installation step. Can you attach full SS and also try the below steps.
Here's how I fixed this issue:
Previously, I was not abled to run the library into Android. I followed the instructions above, but I got no results.
Then I tried to manually linking the library and this is how it works for me:
First, you must search for your android project, something like
include ':rn-scratch-card'
project(':rn-scratch-card').projectDir = new File(rootProject.projectDir, '../node_modules/rn-scratch-card/android')
dependencies {}
objectimplementation project(':rn-scratch-card')
After change all the lines, clean the libraries previously cached:
cd android && cd ./gradlew clean && cd ..
Next, you must add manually to your MainApplication.java that should be into
import com.rnscratchcard.RnScratchCardPackage;
return Arrays.<ReactPackage>asList(
), add new RnScratchCardPackage()
, with a coma before the new line and don't close the array with a coma since this is a java file.If everything went well, you can now use your prefrered build command and the package should be listed and working.
PD: If the building doesn't have any problem, maybe you can't see the scratch: just imported again and it should work. PD2: I used Android Studio for checking the libraries with the autofilling, I recommend to use that just in case you want to be sure.
Hope this could be useful for anyone that is stucked with the lilbrary. Anyways, the autolinking is not working yet and sould be fixed. 👍🏽
@Amansaxena001 Please provide more info for future investigation