Open izzelislam opened 1 year ago
Duplicate of #492.
Please update your Kotlin version to the latest version 1.7.20
. hope this helps
1.7.20
thank , i try first
@izzelislam did this fix the issue for you?
I hope it helps for future readers.
build.gradle (:app) :
android{
...
buildFeatures {
viewBinding = true
}
}
Add it to the Kotlin-plot. because it does the functionality that 'kotlin-android-extensions' provides.
plugins {
...
id 'kotlin-parcelize'
}
You have to set minifyEnabled to True
buildTypes {
release {
minifyEnabled true
...
}
}
MainActivity.kt
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding _//add here_
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater) _//add here_
val view = binding.root _//add here_
setContentView(view) _//add here_
//setContentView(R.layout.activity_main)
}
fun degistir(view : View){
binding.textView.text = "Hello Android" _//worked_
}
}
I hope it helps for future readers.
build.gradle (:app) :
android{ ... buildFeatures { viewBinding = true } }
Add it to the Kotlin-plot. because it does the functionality that 'kotlin-android-extensions' provides.
plugins { ... id 'kotlin-parcelize' }
You have to set minifyEnabled to True
buildTypes { release { minifyEnabled true ... } }
MainActivity.kt
class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding _//add here_ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) _//add here_ val view = binding.root _//add here_ setContentView(view) _//add here_ //setContentView(R.layout.activity_main) } fun degistir(view : View){ binding.textView.text = "Hello Android" _//worked_ } }
this it works for me!!!
I hope it helps for future readers.
build.gradle (:app) :
android{ ... buildFeatures { viewBinding = true } }
Add it to the Kotlin-plot. because it does the functionality that 'kotlin-android-extensions' provides.
plugins { ... id 'kotlin-parcelize' }
You have to set minifyEnabled to True
buildTypes { release { minifyEnabled true ... } }
MainActivity.kt
class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding _//add here_ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) _//add here_ val view = binding.root _//add here_ setContentView(view) _//add here_ //setContentView(R.layout.activity_main) } fun degistir(view : View){ binding.textView.text = "Hello Android" _//worked_ } }
Works For my Project
I hope it helps for future readers.
build.gradle (:app) :
android{ ... buildFeatures { viewBinding = true } }
Add it to the Kotlin-plot. because it does the functionality that 'kotlin-android-extensions' provides.
plugins { ... id 'kotlin-parcelize' }
You have to set minifyEnabled to True
buildTypes { release { minifyEnabled true ... } }
MainActivity.kt
class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding _//add here_ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) _//add here_ val view = binding.root _//add here_ setContentView(view) _//add here_ //setContentView(R.layout.activity_main) } fun degistir(view : View){ binding.textView.text = "Hello Android" _//worked_ } }
this is working, thanks man
I hope it helps for future readers.
build.gradle (:app) :
android{ ... buildFeatures { viewBinding = true } }
Add it to the Kotlin-plot. because it does the functionality that 'kotlin-android-extensions' provides.
plugins { ... id 'kotlin-parcelize' }
You have to set minifyEnabled to True
buildTypes { release { minifyEnabled true ... } }
MainActivity.kt
class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding _//add here_ override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) _//add here_ val view = binding.root _//add here_ setContentView(view) _//add here_ //setContentView(R.layout.activity_main) } fun degistir(view : View){ binding.textView.text = "Hello Android" _//worked_ } }
My RN app doesnt have any MainActivity.kt file. I just have those:
MainActivity.java:
@Override
protected String getMainComponentName() {
return "fieldReportIg";
}
MainApplication.java:
....
...
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
...
...
And as you can see my MainApplication onCreate method is quite different as mentioned. Any suggestion from what should I do?
https://www.youtube.com/watch?v=JtnXzdyL64I&t=46s&ab_channel=UmesroTech Works For my Project
Same here @gabrielporcher i only have MainApplication.java and MainActivity.java and with react-native 0.71.8, any idea ?
I do not have "Kotlin-plot in cordova.
Where could I find that ? Thanks.
I have an error when launch the app after installing the library
anyone can help me to solf this issue ?