Last active
May 15, 2020 17:55
-
-
Save justasm/4a75afd5f5f3e6ba0dbc16b5a1e5331b to your computer and use it in GitHub Desktop.
Kotlin Android Extensions with Android library module https://youtrack.jetbrains.com/issue/KT-16934
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.2" | |
defaultConfig { | |
applicationId "com.example.kxt" | |
minSdkVersion 15 | |
targetSdkVersion 25 | |
versionCode 1 | |
versionName "1.0" | |
} | |
} | |
dependencies { | |
compile 'com.android.support:appcompat-v7:25.2.0' | |
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | |
compile project(':library') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.kxt | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import kotlinx.android.synthetic.main.test.* | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.test) | |
image_view.scaleType = ImageView.ScaleType.CENTER | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext.kotlin_version = '1.1.0' | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:2.3.0' | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} | |
allprojects { | |
repositories { | |
jcenter() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
android { | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.2" | |
defaultConfig { | |
minSdkVersion 15 | |
targetSdkVersion 25 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/image_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
/> | |
</FrameLayout> |
Yes, this is sample code for the issue reported over 3 years ago. The issue has been closed but the issue is not fixed, the latest issue tracking this can be found here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Still it does not work v. 1.3.72