Upgraded to Firebase and having many issues now restarting app - android

I've recently upgraded to firebase from gcm. Which forced me to upgrade my build tools ect. The app uses Play Services to check subscription status, and other wise the it's a basic Push To Talk application. Everything was running fine on GCM with build tools 22... I've implemented firebase just fine and it works properly. The problem I'm having is no matter which three of my activities I launch now or from where (widget, notification, icon) results in an ANR. Mind you the first time I launch the activities they run as expected. Any activity launched the second time gives the ANR. What is going on here?
log errors
06-11 02:45:49.913 32009-32009/com.cb3g.channel19 W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
06-11 02:45:59.883 32009-32030/com.cb3g.channel19 E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.cb3g.channel19-3/base.apk"],nativeLibraryDirectories=[/data/app/com.cb3g.channel19-3/lib/arm64, /vendor/lib64, /system/lib64]]
06-11 02:45:59.883 32009-32030/com.cb3g.channel19 W/ResourcesManager: getTopLevelResources: /data/app/com.google.android.gms-2/base.apk / 1.0 running in com.cb3g.channel19 rsrc of package com.google.android.gms
06-11 02:49:36.923 32009-32009/com.cb3g.channel19 W/AudioManager: setStreamMute is deprecated. adjustStreamVolume should be used instead.
build.gradle:
android {
signingConfigs {
config {
}
}
defaultConfig {
applicationId "com.cb3g.channel19"
minSdkVersion 16
targetSdkVersion 23
versionCode 278
versionName "2.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileSdkVersion 23
buildToolsVersion '22.0.1'
}
dependencies {
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
}
apply plugin: 'com.google.gms.google-services'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cb3g.channel19">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="false"
android:icon="#drawable/smallicon"
android:label="#string/app_name"
android:persistent="true"
android:theme="#style/mytheme"
android:value="AIzaSyadfadfaLJKLKJkldfk">
<activity
android:name=".main_activity"
android:launchMode="singleTask"
android:stateNotNeeded="true"
android:windowSoftInputMode="adjustNothing|stateAlwaysHidden"/>
<activity
android:name=".settings_activity"
android:stateNotNeeded="true"
android:theme="#style/pmstyle"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden"/>
<activity
android:name=".login_activity"
android:stateNotNeeded="true"
android:theme="#style/mytheme"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:priority="247483647">
<action android:name="android.intent.action.VOICE_COMMAND" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name=".radio_service"
android:exported="false"/>
<service
android:name=".MyFcmListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver android:name=".channel19">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/channel19_info" />
</receiver>
</application>
</manifest>
What would cause the ANR upon returning to the Activity?
UPDATE: without the Firebase compile app runs correctly. Ive added the firebase crash compile to attempt to get a Firebase log of the situation to no avail here are the dependencies.
`compile 'com.google.firebase:firebase-messaging:9.0.2'
`compile 'com.google.firebase:firebase-crash:9.0.2'

Related

Android Auto Reject After Change to API 32

after forcing change to api 32 my app are reject every time i try to publish a new app or an update.
The reason is every time the same
"Your app does not respond (no music played or error message shown) after issuing a voice command."
Or:
Voice commands
Media Apps
Your app does not respond (no music played or error message shown) after issuing a voice command.
Messaging Apps
Your app does not respond to “Reply” when confirming or editing custom messages.
Your app does not respond to “Reply,” "Send It,” or “Cancel”.
Nav Apps
Your app does not respond after issuing a voice command.
But on my side the app works fine!
I cannot able to search what is happened, i've only change the api level to 32.
I've ask to review team an help and they reply that can't help me.
What can i do? this manifest will be ok?
<?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.inmystream.radiox">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true">
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="#xml/automotive_app_desc" />
<activity
android:name="stereopesaro.mactechinteractiv.stereopesaro.MainActivity"
android:exported="true"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.car.notification.SmallIcon"
android:resource="#mipmap/ic_launcher" />
<service
android:name="stereopesaro.mactechinteractiv.stereopesaro.AutoMediaBrowserService"
android:exported="true"
tools:ignore="ExportedService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</service>
<!--<receiver-->
<!--android:name="stereopesaro.mactechinteractiv.stereopesaro.Utils.NetworkChangeReceiver"-->
<!--android:label="NetworkChangeReceiver">-->
<!--<intent-filter>-->
<!--<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />-->
<!--</intent-filter>-->
<!--</receiver>-->
<!-- END PushWoosh activities and services -->
<service android:name="stereopesaro.mactechinteractiv.stereopesaro.radio.RadioService" />
<!-- A receiver that will receive media buttons and send as
intents to your MediaBrowserServiceCompat implementation.
Required on pre-Lollipop. More information at
https://developer.android.com/reference/androidx/media/session/MediaButtonReceiver -->
<receiver android:name="androidx.media.session.MediaButtonReceiver"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
</application>
</manifest>
this is my build grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.inmystream.studio54radio"
minSdkVersion 21
targetSdkVersion 31
versionCode 9
versionName '1.2'
multiDexEnabled true
/*lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}*/
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'jp.wasabeef:blurry:4.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'androidx.work:work-runtime-ktx:2.7.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation "androidx.media:media:1.6.0"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp3:okhttp:4.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.karumi:dexter:6.1.2'
implementation 'pub.devrel:easypermissions:0.4.3'
implementation 'com.google.android.exoplayer:exoplayer:2.14.0'
}
before of api change it works and approved...
thanks who can help me!
help to solve this issue

Error: Program type already present: com.getcapacitor.AndroidProtocolHandler

I want to generate APK of the ionic app but I am getting
Program type already present: com.getcapacitor.AndroidProtocolHandler
error while building the ionic 4 app with angular. I have searched this on the internet and find one solution which says change
implementation 'ionic-team:capacitor-android:1+'
to
implementation project(':capacitor-android')"
in dependencies in build.gradle file but I already have implementation project(':capacitor-android')" in my dependency and I'm still getting the error.
This is link to the solution I have tried: https://github.com/oxylian/capacitor-facebook-login/issues/3
This is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "io.ionic.starter"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://dl.bintray.com/ionic-team/capacitor"
}
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation project(':capacitor-android')
// implementation 'ionic-team:capacitor-android:1+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
This is my AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.ionic.starter">
<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:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:name="io.ionic.starter.MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/custom_url_scheme" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Camera, Photos, input file -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Geolocation API -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
<!-- Network API -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Navigator.getUserMedia -->
<!-- Video -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- Audio -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
</manifest>
The problem is the date picker plugin, it has that line that you have mentioned
https://github.com/triniwiz/capacitor-datepicker/blob/master/src/android/capacitor-datepicker/build.gradle#L45
There is a pull request fixing it, but hasn’t been merged
https://github.com/triniwiz/capacitor-datepicker/pull/12

After migration to AndroidX, exception at start up: java.lang.ClassNotFoundException: "Didn't find class androidx.core.app.CoreComponentFactory"

After migration to AndroidX i have the following exception at startup:
LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/com.apps.entertainmentsolutions.offhole-yUKw5A4ysDVrPyO-DpnhKg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:217)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:329)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5410)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1743)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at com.android.server.SystemServer.run(SystemServer.java:460)
at com.android.server.SystemServer.main(SystemServer.java:300)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
I´m using Android Studio 3.4.1 in Windows 10.
I tried all solutions that I could find, but the problem persists:
Android design support library for API 28 (P) not working
AndroidX Build Fails in Release Mode regarding appComponentFactory
I added -keep class androidx.core.app.CoreComponentFactory { *; } to proguard-rules.pro, i added android.useAndroidX=true and android.enableJetifier=true to gradle.properties... clean, re-built, invalidate chaches and restart...
Disable instant run, too...
Another curious fact, is that I can import the class without problems (import androidx.core.app.CoreComponentFactory;) from other classes.
My gradle files. Project gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.0'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App gradle:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "co.offtime.kit"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
beta {
versionNameSuffix ".beta"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
signingConfig signingConfigs.debug
}
debug {
versionNameSuffix ".debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt' ), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
productFlavors {
//main application
kit {
applicationId "co.offtime.kit"
dimension "release"
versionName "v.kit.4.0"
versionCode 236
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
def AAVersion = '4.6.0'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
implementation "org.androidannotations:androidannotations-api:$AAVersion"
implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.4.1'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.4.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.4.1'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
}
apply plugin: 'com.google.gms.google-services'
Gradle properties:
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
Proguard:
-keep class androidx.core.app.CoreComponentFactory { *; }
Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
<application
android:name="co.offtime.kit.core.AppGlobals_"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="co.offtime.kit.SplashScreen_"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.offtime.app"
android:scheme="http" />
</intent-filter>
</activity>
<activity
android:name=".ParentActivity_"
android:label="parentActivity" />
<activity
android:name="co.offtime.kit.InitialDataLoadActivity_"
android:parentActivityName=".ParentActivity_" />
<activity
android:name="co.offtime.kit.LoginActivity_"
android:configChanges="orientation|screenSize"
android:label="#string/login_title"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name="co.offtime.kit.NewUserFormActivity_"
android:configChanges="orientation|screenSize"
android:label="#string/new_user_form_title"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name="co.offtime.kit.TestButtonsActivity_"
android:label="#string/app_name"
android:parentActivityName="co.offtime.kit.DisableHardwareButtonsActivity_">
</activity>
<activity
android:name="co.offtime.kit.DisableHardwareButtonsActivity_"
android:label="disableHardwareButtonsActivity" />
<activity
android:name="co.offtime.kit.EventListActivity_"
android:label="#string/event_list_title" />
<activity
android:name="co.offtime.kit.EventDetailFormActivity_"
android:label="#string/new_event_title" />
<!-- ACTIVITIES -->
<activity
android:name="co.offtime.kit.BlockActivity_"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask"
android:parentActivityName="co.offtime.kit.DisableHardwareButtonsActivity_"
android:screenOrientation="portrait" />
<service android:name="co.offtime.kit.core.services.ClosingAppWatcherService_"
android:stopWithTask="false" />
<receiver android:name="co.offtime.kit.core.AvoidCameraUseDeviceAdminReceiver"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="#xml/device_policies" />
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_notifications_white_24dp" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED" />
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
</intent-filter>
</receiver>
<receiver android:name="co.offtime.kit.core.broadcastreceiver.CallBlockerReceiver_">
<intent-filter android:priority="9999">
<action android:name="android.intent.action.PHONE_STATE" />
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
<receiver
android:name="co.offtime.kit.core.broadcastreceiver.BootCompleteDeviceBroadcastReceiver_"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service
android:name="co.offtime.kit.core.services.LaunchBlockJobService"
android:label="LaunchBlockJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service android:name="co.offtime.kit.core.services.EventExecutorService_"
android:enabled="true"
android:exported="true"
android:stopWithTask="false" />
<service android:name="co.offtime.kit.core.fcmpushnotifications.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="co.offtime.kit.core.fcmpushnotifications.FcmTokenUpdateService_"
android:enabled="true"
android:exported="true"
android:stopWithTask="false" />
</application>
For now this doesn't cause an ANR, the app starts and works normally, but i'm afraid it will cause problems in the future, and i would like to know why that's happening.
Has anyone had this problem? How was it solved?
Looks CoreComponentFactory class is getting encrypted. Try adding the above class to proguard-rules.
-keep class androidx.core.app.CoreComponentFactory { *; }
So the CoreComponentFactory won't be the encrypted anymore.
I hit this error while trying to run a debug android app on an AVD emulator.
Wiping the data from the emulator (from the AVD Manager) fixed the issue.
After reviewing an Android Issue Tracker bug report from this question, I saw a mention about multidex support. I had no multidex flags specified in my project, so I tried setting the flag to false on all modules in my project, and the exception went away.
This was not a permanent solution; the problem returned a few builds later.

Packaging separate wear apks for android wear 1.x and 2.0

I am attempting to create a standalone Android Wear app for 1.x and 2. I followed the steps on the android developer page, but users say the wear apk isn't automatically installing on their 1.x watch. The mobile app has the same permissions. This is only here to get the wear apk to install. There are no activities on the mobile app.
Do I need to package the wear app in my mobile app? From what I read this shouldn't be done even for 1.x.
Here is a preview of what my apks look like in the developer console:
Mobile Manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/Theme.Nav">
</application>
Wear Manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-feature android:name="android.hardware.type.watch" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<!-- Required for complications to receive complication data and open the provider chooser. -->
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/Theme.Nav">
<uses-library
android:name="com.google.android.wearable"
android:required="false" />
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<activity android:name=".ui.activity.SplashActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main activity for music browsing on phone -->
<activity android:name=".ui.activity.MainActivity"
android:launchMode = "singleTop">
</activity>
<service android:name=".service.MediaPlayerService" />
<activity android:name="android.support.wearable.activity.ConfirmationActivity" />
<!--
Main music service, provides media browsing and media playback services to
consumers through MediaBrowserService and MediaSession. Consumers connect to it through
MediaBrowser (for browsing) and MediaController (for play session control)
-->
<service android:name=".service.FsService" />
<service android:name=".service.NsdService" />
<receiver
android:name=".service.NsdService$StartStopReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.turndapage.navmusic.FTPSERVER_STARTED" />
<action android:name="com.turndapage.navmusic.FTPSERVER_STOPPED" />
</intent-filter>
</receiver>
<!-- Don't export this receiver in free, this clashes with paid -->
<receiver
android:name=".RequestStartStopReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.turndapage.navmusic.ACTION_START_FTPSERVER" />
<action android:name="com.turndapage.navmusic.ACTION_STOP_FTPSERVER" />
</intent-filter>
</receiver>
<receiver android:name=".WifiStateChangeReceiver">
<intent-filter>
<action android:name="android.net.wifi.STATE_CHANGE" />
</intent-filter>
</receiver>
<service android:name=".WifiStateChangeReceiver$StartServerService" />
<service android:name=".WifiStateChangeReceiver$StopServerService" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<service
android:name=".watchface.AnalogComplicationWatchFaceService"
android:enabled="true"
android:label="#string/my_analog_name"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="#drawable/preview_analog" />
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="#drawable/preview_analog" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="com.turndapage.navmusic.CONFIG_COMPLICATION_SIMPLE"/>
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
<activity android:name="android.support.wearable.complications.ComplicationHelperActivity"/>
<activity
android:name=".config.AnalogComplicationConfigActivity"
android:label="#string/analog_complication_config">
<intent-filter>
<action android:name="com.turndapage.navmusic.CONFIG_COMPLICATION_SIMPLE"/>
<category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<receiver android:name=".provider.ComplicationToggleReceiver"/>
<activity android:name=".config.ColorSelectionActivity"/>
<service android:name=".provider.CurrentSongComplicationProvider"
android:icon="#drawable/ic_library_music_white_24dp"
android:label="#string/current_song"
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
<intent-filter>
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST"/>
</intent-filter>
<meta-data
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
android:value="SHORT_TEXT,LONG_TEXT"/>
<meta-data
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
android:value="0"/>
</service>
<service android:name=".provider.SkipBackComplicationProvider"
android:icon="#drawable/ic_skip_previous_white_24dp"
android:label="#string/skip_back"
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
<intent-filter>
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST"/>
</intent-filter>
<meta-data
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
android:value="ICON"/>
<meta-data
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
android:value="0"/>
</service>
<service android:name=".provider.SkipForwardComplicationProvider"
android:icon="#drawable/ic_skip_next_white_24dp"
android:label="#string/skip_next"
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
<intent-filter>
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST"/>
</intent-filter>
<meta-data
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
android:value="ICON"/>
<meta-data
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
android:value="0"/>
</service>
<service android:name=".provider.PlayPauseComplicationProvider"
android:icon="#drawable/ic_media_play_dark"
android:label="#string/play_pause"
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
<intent-filter>
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST"/>
</intent-filter>
<meta-data
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
android:value="ICON"/>
<meta-data
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
android:value="0"/>
</service>
<!-- Watch face stuff -->
</application>
Mobile Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.turndapage.navmusic"
minSdkVersion 15
targetSdkVersion 26
versionCode 260350011
versionName "0.3.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
wearAppUnbundled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Wear gradle:
plugins {
id "me.tatarka.retrolambda" version "3.5.0"
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.turndapage.navmusic"
minSdkVersion 23
targetSdkVersion 26
versionCode 260350010
versionName "0.3.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// Needed for retrolambda
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.support:wearable:2.0.3'
compile 'com.android.support:wear:26.0.1'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
compile 'com.google.android.exoplayer:exoplayer:r2.4.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.github.kabouzeid:app-theme-helper:1.3.7'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:preference-v7:26.0.1'
compile 'com.android.support:mediarouter-v7:26.0.1'
compile 'com.android.support:percent:26.0.1'
compile 'net.vrallev.android:cat:1.0.5'
compile 'org.projectlombok:lombok:1.16.18'
compile 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
compile 'com.google.android.gms:play-services-fitness:11.0.4'
compile 'com.android.support:palette-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
provided 'com.google.android.wearable:wearable:2.0.3'
}
[Edit] I had to update to include complication permissions and remove the watch feature on the mobile app to get it to upload to the play store. Some users report it is installing, but others can't get it to work.
Your assumption is correct, you should not embed the wear APK inside the phone APK (this was the old way of doing it). However, you still need to publish the phone APK.
There are only 2 APKs in your screen shot. There should be 3 in total: phone APK for AW 1.x, wear APK for AW 1.x, and wear APK for AW 2.x.
Make sure that the AW 2.0 APK has the highest version code, followed by the AW 1.x watch APK, and finally the AW 1.x phone APK.
Note that that the wearAppUnbundled true flag (in your phone gradle file) is only needed if you've previously published an AW 1.x app with an embedded wear APK (but it shouldn't hurt to include it otherwise).

Unresolved symbols in Android Studio

I'm trying to add GCM to my app, so I'm following this guide.
But I'm getting unresolved symbol error on:
import android.support.v7.app.AppCompatActivity;
and on my R library
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.examplegcm"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="com.example.examplegcm.permission.C2D_MESSAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.SEND"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/MyTheme" >
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.examplegcm" />
</intent-filter>
</receiver>
<service
android:name="com.example.examplegcm.chatGCM.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.example.examplegcm.chatGCM.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<activity
android:name=".MainApplication"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
</application>
</manifest>
Here are my gradles:
Top Level:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
jcenter()
}
}
App:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.alaarami.letsrun"
minSdkVersion 16
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/slf4j-api-1.7.12.jar')
compile files('libs/slf4j-simple-1.7.12.jar')
apply plugin: 'com.google.gms.google-services'
compile 'com.google.android.gms:play-services:7.5.0'
}
Compile Sdk Version: 16
Build Tools Version: 22.0.1
jdk: 1.8
Installed SDK's:
UPDATE:
It's resolved... I dunno how. Didn't do anything
Add to your dependencies
compile 'com.android.support:appcompat-v7:21.0.3'
This is the artifact that contains AppCompatActivity.

Categories

Resources