I have a problem and I am creating an Android Bundle app, but I do not create the activities in the Dynamic Modules, I just get this error:
Unresolved reference: app
This is the main app build.gradle code:
android {
compileSdkVersion 28
defaultConfig {
applicationId "bundletest.hitcel.com.bundletest"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
bundle {
language {
enableSplit = true
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
dynamicFeatures = [":Chat", ":Estadisticas"]
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
and this one of my dynamic module:
apply plugin: 'com.android.dynamic-feature'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':app')
}
But it still does not work, start it based on the following Google Developers tutorial
enter the description of the link here
Neither Clean project nor Build Project solve and all this remains in red in my ChatActivity.tk:
package bundletest.hitcel.com.chat
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
class ChatActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_chat)
}
}
This is the structure of my project:
I would appreciate any suggestion to solve it. Thanks in advance.