Android Studio 4 getting RuntimeException Unable to instantiate activity ComponentInfo - android

After fresh download of android studio 4.0 getting RuntimeException and ClassNotFoundException on simple Hello World WearOs apps. Successfully build the project but in installation time getting this error. I tried all possible solution from google search, but didn't work any solution for me.
My Gradle script for app module :
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.example.minimumwear"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.google.android.support:wearable:2.7.0'
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.wear:wear:1.0.0'
compileOnly 'com.google.android.wearable:wearable:2.7.0'
}
My ActivityClass :
public class MainActivity extends WearableActivity {
private TextView mTextView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTextView = (TextView) findViewById(R.id.text);
// Enables Always-on
setAmbientEnabled();
}
}
My Manifest file :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.minimumwear">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.DeviceDefault">
<uses-library
android:name="com.google.android.wearable"
android:required="true" />
<!--
Set to true if your app is Standalone, that is, it does not require the handheld
app to run.
-->
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And My error log looks like :
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.minimumwear/com.example.minimumwear.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.minimumwear.MainActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.wearable.jar", zip file "/data/app/com.example.minimumwear-Obx1w-cp5WLQr4-dZvR-ng==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.minimumwear-Obx1w-cp5WLQr4-dZvR-ng==/lib/x86, /system/lib]]
And
java.lang.ClassNotFoundException: Didn't find class "com.example.minimumwear.MainActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.wearable.jar", zip file "/data/app/com.example.minimumwear-Obx1w-cp5WLQr4-dZvR-ng==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.minimumwear-Obx1w-cp5WLQr4-dZvR-ng==/lib/x86, /system/lib]]

After updating the IDE, some old files not worked properly. You should have to remove those files.
C:\Users%USERNAME%
.android
.gradle
After removing those items, make sure you first create a new project not opening an existing project.
After successfully finished Gradle Build, run App on your device.
Then you can open your old projects and make some changes in these Gradle files:
build.gradle(Project)
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle-wrapper.properties
#Sun May 03 10:02:16 IST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Hope this helps.

test it
android {
compileSdkVersion 29
buildToolsVersion "30.0.0"
defaultConfig {
applicationId "com.example.minimumwear"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
}
manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
</manifest>
application:
public class MyApplication extends MultiDexApplication {
}

Related

Android auto manifest merger failed: attribute is also present at

I'm currently trying to build a hello world app as my first android auto app. Earlier, when I was trying to run the app it was giving me some minSdk error and I managed to fix that. Now, when I try to run it, it gives me this error:
Manifest merger failed : Attribute meta-data#androidx.car.app.CarAppMetadataHolderService.CAR_HARDWARE_MANAGER#value value=(androidx.car.app.hardware.ProjectedCarHardwareManager) from [androidx.car.app:app-projected:1.1.0] AndroidManifest.xml:34:17-86
is also present at [androidx.car.app:app-automotive:1.1.0] AndroidManifest.xml:44:17-87 value=(androidx.car.app.hardware.AutomotiveCarHardwareManager).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml to override.
I've been trying to follow the instructions here on how to edit the manifest file and everything looks fine according to the instructions.
Here's the AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.smartherd.helloworld">
<uses-feature
android:name="android.hardware.type.automotive"
android:required="true" />
<application
android:allowBackup="true"
android:appCategory="audio"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.HelloWorld">
<service
android:name=".HelloWorldService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService"/>
<category android:name="androidx.car.app.category.POI"/>
</intent-filter>
</service>
<meta-data
android:name="androidx.car.app.minCarApiLevel"
android:value="1"/>
</application>
</manifest>
Build.gradle:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.smartherd.helloworld"
minSdk 29
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation("androidx.car.app:app:1.1.0")
// For Android Auto specific functionality
implementation("androidx.car.app:app-projected:1.1.0")
// For Android Automotive specific functionality
implementation("androidx.car.app:app-automotive:1.1.0")
// For testing
testImplementation("androidx.car.app:app-testing:1.2.0-rc01")
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Since you are targeting Android Automotive in your manifest, you can get rid of the following dependency in your gradle file:
implementation("androidx.car.app:app-projected:1.1.0")
That should fix the conflict you are having.

Android plugin in Unity

i am trying to add a local .aar from an android library in Unity. Currently it is a very basic project, in unity there is just one script that opens the activity from android library on a button click.
I manually added the .aar in the /plugins/android folder (I am using 2019.4 version), and on build I keep getting the error that a resource is not found (Theme.AppCompat.Light.NoActionBar' not found in AndroidManifest)
.
This are my graddle config & AndroidManifest:
plugins {
id 'com.android.library'
}
android {
compileSdk 31
defaultConfig {
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation "com.facebook.react:react-native:+"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
//(MainApplication) Manual ReactPackage Setup here...
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesAppBuildGradle(project)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:supportsRtl="true"
>
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity
android:name=".ReactNativeActivity"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize" />
</application>
</manifest>
I am a newbie when it comes to mobile development, but I think the issue is that the dependencies from build.graddle are not included in the .aar.
I think my options are to either create a fat .aar , manually download dependencies .aar's or to publish .aar to a central repository. Am I on the right track?
Any help is more than appriciated
I manage to get over the error by adding a custom graddle template to the unity project.

Didn't find class "com.example.android.App" on path: DexPathList on Android 4

I have Kotlin MultiDex application using Dagger 2 for DI. Everything almost fine, but I have device with API 17 (Android 4.2.2), and sometimes application crashes immediately after launch with exception
java.lang.RuntimeException: Unable to instantiate application com.example.android.App: java.lang.ClassNotFoundException: Didn't find class "com.example.android.App" on path: DexPathList[[zip file "/data/app/com.example.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.android-1, /vendor/lib, /system/lib]]
Typically, this occurs after the Build -> Project also after File -> Invalidate caches / Restart but not always. Usually Rebuild project helps but I would like to completely fix these situations.
Please tell me what could be the problem?
My build.gradle (not full):
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply plugin: 'io.sentry.android.gradle'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.android"
minSdkVersion 16
targetSdkVersion 27
versionCode 58
versionName "1.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "example.apk"
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11"
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0"
...
// LiveData + ViewModel
implementation "android.arch.lifecycle:extensions:1.1.1"
implementation "com.android.support:multidex:1.0.3"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
...
// Dagger
implementation "com.google.dagger:dagger:2.19"
implementation "com.google.dagger:dagger-android-support:2.19"
kapt "com.google.dagger:dagger-compiler:2.19"
kapt "com.google.dagger:dagger-android-processor:2.19"
...
}
My AndroidManifest.xml (not full):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.android">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:name=".activities.SplashActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
</application>
</manifest>
My application class (App.kt, not full)
class App: DaggerApplication() {
override fun onCreate() {
super.onCreate()
...
}
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
MultiDex.install(this)
}
override fun applicationInjector(): AndroidInjector<out DaggerApplication> =
DaggerAppComponent.builder().application(this).build()
}
}

Getting error while generate the APK build and try to run it from device instant app

Instant app working FINE while run the app from android studio but, getting errors while generate the APK build and try to run it from device
getting below error in xiaomi noughat device
instant app crash by giving this message "There was a problem parsing the package"
I have used instant app development version 1.3.0 and also enabled instant app setting from settings > google > instant apps
E/Icon: Unable to load resource 0x00000000 from pkg=com.android.systemui
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:201)
at android.content.res.MiuiResourcesImpl.getValue(MiuiResourcesImpl.java:91)
at android.content.res.Resources.getDrawable(Resources.java:784)
at android.graphics.drawable.Icon.loadDrawableInner(Icon.java:316)
at android.graphics.drawable.Icon.loadDrawable(Icon.java:272)
at android.graphics.drawable.Icon.loadDrawableAsUser(Icon.java:380)
at com.android.systemui.statusbar.ExpandedIcon.getDrawable(ExpandedIcon.java:59)
at com.android.systemui.statusbar.StatusBarIconView.getIcon(StatusBarIconView.java:174)
at com.android.systemui.statusbar.StatusBarIconView.setIcon(StatusBarIconView.java:133)
at com.android.systemui.statusbar.StatusBarIconView.updateDarkMode(StatusBarIconView.java:266)
at com.android.systemui.statusbar.phone.SimpleStatusBar.updateDarkMode(SimpleStatusBar.java:264)
at com.android.systemui.statusbar.phone.PhoneStatusBar$17.run(PhoneStatusBar.java:3494)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6195)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
and getting below error in lollipop device
package - Android: Parse error when parsing manifest. Discontinuing installation
Here i listed out manifest files and gradle files of my project
instantapp gradle
apply plugin: 'com.android.instantapp'
dependencies {
implementation project(':feature')
implementation project(':base')}
feature module gradle and manifest
apply plugin: 'com.android.feature'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':base')
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'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp.feature">
<uses-permission android:name="android.permission.INTERNET" />
<application>
<activity android:name="com.example.myfirstinstantapp.feature.MainActivity">
<meta-data
android:name="default-url"
android:value="https://myfirstinstantapp.example.com/hello" />
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="myfirstinstantapp.example.com"
android:pathPattern="/.*"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
===========================================
base module gradle and manifest
apply plugin: 'com.android.feature'
android {
compileSdkVersion 28
baseFeature true
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api 'com.android.support:appcompat-v7:28.0.0-alpha3'
api 'com.android.support.constraint:constraint-layout:1.1.2'
application project(':app')
feature project(':feature')
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity" />
</application>
</manifest>
===========================================
app gradle and manifest
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myfirstinstantapp.app"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(':feature')
implementation project(':base')
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstinstantapp.app" />
===========================================
project level gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here i attached screenshot of my project structure

Android application on Gradle: Unable to merge dex

I have an error with my app in Android studio:
Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I use Gradle and Kotlin.
Android Studio 3.0.1.
Windows 10 Pro 64.
I have research this theme on SO and I have tried some solution from here, like that:
Clean and rebuild project. No changes.
Change 'compile' in gradle to 'implementation'. No changes.
Delete .gradle and build directories. No changes.
Add multiDexEnabled true in defaultConfig in gradle. In this case, I have another error:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> java.io.IOException: Can't write [G:\work\myapp\app\build\intermediates\multi-dex\debug\componentClasses.jar]
(Can't read [C:\Users\Public\.gradle\caches\transforms-1\files-1.1\support-core-utils-27.0.2.aar\e1c9881d763269b67bf59dc03d19c305\jars\classes.jar(;;;;;;**.class)]
(Duplicate zip entry [classes.jar:android/support/v4/content/PermissionChecker$PermissionResult.class]))
My build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
multiDexEnabled true
applicationId "myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
applicationIdSuffix ".dev"
}
staging {
debuggable true
applicationIdSuffix ".sta"
}
preproduction {
applicationIdSuffix ".pre"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.basecamp:turbolinks:1.0.7'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// The Client SDK resides on jCenter
implementation 'com.twilio:client-android:1.2.21'
}
My AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tunnll.passenger">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.twilio.client.TwilioClientService"
android:exported="false" android:stopWithTask="true"/>
</application>
What am I missing?
UPD
It seems I found out the point after that the problem has appeared. It was after adding Twilio configuration. I used this manual: Twilio and Android
This is all changes that have been done:
Add to build.gradle:
implementation 'com.twilio:client-android:1.2.21'
Add to AndroidManifest:
<service android:name="com.twilio.client.TwilioClientService"
android:exported="false" android:stopWithTask="true"/>
Add to proguard-rules.pro
# Twilio Client
-keep class com.twilio.** { *; }
# Apache HttpClient
-dontwarn org.apache.http.**
That's all. Before this changes I didn't have this error
Use this in your build.gradle in app Module if you want to read an .aar file
for your libs dir:
repositories{
flatDir{
dirs 'libs'
}
}
dependencies {
compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}
But it seems that your problem is multidex(means that you have more than 65K methods in your project so use this:
android {
defaultConfig {
multiDexEnabled true
}
}
and if your minSdk < 20 then use this as well:
compile 'com.android.support:multidex:1.0.1'
Hope it helps!!!

Categories

Resources