Issue in InAppWebView plugin - android

I was facing with this error while using InAppWebView Plugin, please guide where im doing mistake. How to resolve this?
W/System.err(30308): java.lang.IllegalArgumentException: Couldn't find meta-data for provider with authority com.nine_am.app.flutter_inappwebview.fileprovider
W/System.err(30308): at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:606)
W/System.err(30308): at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
W/System.err(30308): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
W/System.err(30308): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.getOutputUri(InAppWebViewChromeClient.java:1052)
W/System.err(30308): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.getPhotoIntent(InAppWebViewChromeClient.java:938)
W/System.err(30308): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.startPhotoPickerIntent(InAppWebViewChromeClient.java:895)
W/System.err(30308): at com.pichillilorenzo.flutter_inappwebview.InAppWebView.InAppWebViewChromeClient.onShowFileChooser(InAppWebViewChromeClient.java:799)
W/System.err(30308): at co.runFileChooser(PG:10)
W/System.err(30308): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(30308): at android.os.MessageQueue.next(MessageQueue.java:336)
W/System.err(30308): at android.os.Looper.loop(Looper.java:181)
W/System.err(30308): at android.app.ActivityThread.main(ActivityThread.java:7520)
W/System.err(30308): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(30308): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
W/System.err(30308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
F/chromium(30308): [FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
F/libc (30308): Fatal signal 5 (SIGTRAP), code -6 (SI_TKILL) in tid 30308 (com.nine_am.app), pid 30308 (com.nine_am.app)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
If added provider tag it shows error like this, look over it, and I added provider_paths.xml file in the path res>xml>provider_paths.xml
E/AndroidRuntime(16711): java.lang.RuntimeException: Unable to get provider com.nine_am.app.flutter_inappwebview.InAppWebViewFileProvider: java.lang.ClassNotFoundException: Didn't find class "com.nine_am.app.flutter_inappwebview.InAppWebViewFileProvider" on path: DexPathList[[zip file "/data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/lib/arm64, /data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
E/AndroidRuntime(16711): at android.app.ActivityThread.installProvider(ActivityThread.java:7152)
E/AndroidRuntime(16711): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6630)
E/AndroidRuntime(16711): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6525)
E/AndroidRuntime(16711): at android.app.ActivityThread.access$1400(ActivityThread.java:220)
E/AndroidRuntime(16711): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1883)
E/AndroidRuntime(16711): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(16711): at android.os.Looper.loop(Looper.java:224)
E/AndroidRuntime(16711): at android.app.ActivityThread.main(ActivityThread.java:7520)
E/AndroidRuntime(16711): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16711): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(16711): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/AndroidRuntime(16711): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.nine_am.app.flutter_inappwebview.InAppWebViewFileProvider" on path: DexPathList[[zip file "/data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/lib/arm64, /data/app/com.nine_am.app-ytDaqFCP0M6-QPYD_HI-wQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
Here is my manifest.xml, Please look below
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nine_am.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="9am"
android:usesCleartextTraffic="true"
android:icon="#mipmap/launcher_icon">
<provider
android:name="com.com.nine_am.app.flutter_inappwebview.InAppWebViewFileProvider"
android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Please look over this all and give me a solution. Thanks in Advance!

regiser your provider in AndroidManifest.xml
<provider
android:name="com.com.nine_am.app.flutter_inappwebview.InAppWebViewFileProvider"
android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths" />
</provider>
EDIT
Add multidex into android
see here are the steps https://developer.android.com/studio/build/multidex

Related

Class not found exception on firebase messaging flutter

I keep getting classNotFoundException when sending cloud notifications from firebase. The error logs that it can not find .java.MyFirebaseMessagingService I have followed everything as per the documentation but still can not find the fix.
Here's the error log. The app opens fine and only crashes when I send a message from the firebase console to test.
java.lang.RuntimeException: Unable to instantiate service com.myapp.MyApp.MyFirebaseMessagingService: java.lang.ClassNotFoundException: Didn't find class "com.myapp.MyApp.MyFirebaseMessagingService" on path: DexPathList[[zip file "/data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/lib/arm64, /data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
E/AndroidRuntime( 5956): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3577)
E/AndroidRuntime( 5956): at android.app.ActivityThread.-wrap4(Unknown Source:0)
E/AndroidRuntime( 5956): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1862)
E/AndroidRuntime( 5956): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 5956): at android.os.Looper.loop(Looper.java:198)
E/AndroidRuntime( 5956): at android.app.ActivityThread.main(ActivityThread.java:7055)
E/AndroidRuntime( 5956): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5956): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
E/AndroidRuntime( 5956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:836)
E/AndroidRuntime( 5956): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.myapp.MyAppMyFirebaseMessagingService" on path: DexPathList[[zip file "/data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/lib/arm64, /data/app/com.myapp.MyApp-2_H2R81paYjm5b8ZDse8Uw==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
E/AndroidRuntime( 5956): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
E/AndroidRuntime( 5956): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 5956): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 5956): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3574)
E/AndroidRuntime( 5956): ... 8 more
And the manifest file is.
<application
android:name=".Application"
android:label="MyApp"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:showWhenLocked="true"
android:turnScreenOn="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/ic_logo" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/colorAccent" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name=".service.MyFirebaseMessagingService"
>
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
I know that the question is answered but recently I too got stuck in the same issue and your comment saved me. Thanks! I want to increase the visibility of your answer for others.
To resolve this issue. I just removed this code segment and the application started working as intended:
<service
android:name=".service.MyFirebaseMessagingService"
>
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
I think there is no need to explicitly declare class .service.MyFirebaseMessagingService as you don't need to mention it for the projects.
Follow all the instructions provided in the firebase_messaging | Flutter Package. You may get one error error: incompatible types: PluginRegistry cannot be converted to FlutterEngine GeneratedPluginRegistrant.register with (registry); while following the instruction. To solve this error, follow the instructions provided in this thread: PluginRegistry cannot be converted to FlutterEngine
and you won't face any issues.
If you want to listen for messages on Background / Foreground , You don't need :
<service android:name=".service.MyFirebaseMessagingService">
The Flutter Package gives to you other tools to make this happen.
If you want to use Flutter for listening to Firebase PushNotifications (and not the native way), try to use the FirebaseMessaging.onMessage.listen( ... ) dart function.
And remember, for android:
If the application is currently in the foreground, the visible notification is not presented by default (but you can make it happen).
You can check how to use the notification handling in the Firebase flutter documentation:
https://firebase.flutter.dev/docs/messaging/notifications/
✌️

java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException

Suddenly, I tried to open my application and the app did not wanted to start. It stopped before opening it. I started searching and tried all of other similar questions, but none worked. this is my log:
2020-07-18 22:27:41.652 21042-21042/? I/art: Not late-enabling -Xcheck:jni (already on)
2020-07-18 22:27:41.652 21042-21042/? W/art: Unexpected CPU variant for X86 using defaults: x86
2020-07-18 22:27:41.878 21042-21042/? W/System: ClassLoader referenced unknown path: /data/app/com.ainimei.remotemouse-1/lib/x86
2020-07-18 22:27:41.900 21042-21042/? D/AndroidRuntime: Shutting down VM
2020-07-18 22:27:41.900 21042-21042/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ainimei.remotemouse, PID: 21042
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalStateException:
******************************************************************************
* The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers *
* should follow the instructions here: *
* https://googlemobileadssdk.page.link/admob-android-update-manifest *
* to add a valid App ID inside the AndroidManifest. *
* Google Ad Manager publishers should follow instructions here: *
* https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. *
******************************************************************************
at com.google.android.gms.internal.ads.zzyz.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:33)
at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite##19.2.0:3)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
... 10 more
here is my androidManifest.xml:
note that the code has no meta-data tag. But I never needed it until now. Also my app does not use ads on it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ainimei.remotemouse">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="#drawable/ainimei_logo_icon"
android:label="#string/app_name"
android:roundIcon="#drawable/ainimei_logo_icon"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SelectConnectionType" />
<activity android:name=".ControlBluetoothConnection" />
<activity android:name=".Connection" />
<activity
android:name=".KeyboardActivity"
android:screenOrientation="landscape" />
<activity
android:name=".ProfileSettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".loginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".buyPremiumActivity"
android:screenOrientation="portrait" />
<activity
android:name=".select_control"
android:screenOrientation="portrait" />
<activity
android:name=".SettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I keep trying anyways.
In your manifest file , inside the application tag put this code
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
/// pass the key generated from your admob which contains ~(APP ID)
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/> //
</application>
just check whether meta-data tag is out of activity tag
if it is like this
<manifest>
<application>
<activity>
<meta-data>
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</activity>
</application>
</manifest>
this should be changed to this
<manifest>
<application>
<activity>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-4347201915048498~6120388314"/>
</application>
</manifest>

Ionic Build error with Android Studio.

I have made functional changes in my ionic app and tested in browser by ionic serve. Everything went fine and proceeded for ionic build. So it returned me below error.
I:\myprojects\fizion>ionic package info 30
id │ 30
status │ FAILED
platform │ android
mode │ debug
started │ Jul 30th, 2017 10:32:28
output:
ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /opt/android-sdk/tools/templates/gradle/wrapper
I am not sure whose Android SDK it is suggesting to upgrade. Mine or ionic cloud's ?
Ok, I tried to upgrade my android studio SDK and then other problem started. Then I have issued below command to propogate the new changes to the android.
cordova prepare android
I have built the .apk file and launched in phone. It crashed, so tried in emulator and got the below error.
--------- beginning of crash
07-30 12:18:53.350 3040-3040/com.ionicframework.fizion233539 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ionicframework.fizion233539, PID: 3040
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ionicframework.fizion233539/com.ionicframework.fizion233539.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.ionicframework.fizion233539.MainActivity" on path: DexPathList[[zip file "/data/app/com.ionicframework.fizion233539-1/base.apk"],nativeLibraryDirectories=[/data/app/com.ionicframework.fizion233539-1/lib/x86_64, /vendor/lib64, /system/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ionicframework.fizion233539.MainActivity" on path: DexPathList[[zip file "/data/app/com.ionicframework.fizion233539-1/base.apk"],nativeLibraryDirectories=[/data/app/com.ionicframework.fizion233539-1/lib/x86_64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
Suppressed: java.lang.NoClassDefFoundError: com.ionicframework.fizion233539.MainActivity
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:338)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 13 more
Suppressed: java.lang.ClassNotFoundException: com.ionicframework.fizion233539.MainActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
07-30 12:18:53.352 1584-1596/system_process W/ActivityManager: Force finishing activity com.ionicframework.fizion233539/.MainActivity
my manifest file:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.ionicframework.fizion233539" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="#android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="https://hs7pj.app.goo.gl/" android:scheme="https" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="fizion-f4286.firebaseapp.com" android:path="/__/auth/callback" android:scheme="https" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
<uses-feature android:name="android.hardware.location.gps" />
</manifest>
I have been going through many SO posts and tried many but nothing worked out.
I am happy to share my android studio screenshots for configurations. I am sure this is due to upgrade of android studio but where to crack it.
Could someone guide me I am blocked.
My android studio was showing me warning mentioned in the below post. So I ignored it. But that is the culprit and fixed the issue.
Android, IntelliJ Idea, changing module type

My app gets stopped unfortunately when I use Sugar ORM

Using these configurations I did add sugar orm to my project, but my application stopped unfortunately by this error :
FATAL EXCEPTION: main
Process: gigacycle.geoaudiotag, PID: 22760
java.lang.RuntimeException: Unable to instantiate application com.orm.SugarApp: java.lang.ClassNotFoundException: Didn't find class "com.orm.SugarApp" on path: DexPathList[[zip file "/data/app/gigacycle.geoaudiotag-1/base.apk"],nativeLibraryDirectories=[/data/app/gigacycle.geoaudiotag-1/lib/arm, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:676)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6289)
at android.app.ActivityThread.access$1800(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1860)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.orm.SugarApp" on path: DexPathList[[zip file "/data/app/gigacycle.geoaudiotag-1/base.apk"],nativeLibraryDirectories=[/data/app/gigacycle.geoaudiotag-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newApplication(Instrumentation.java:1004)
at android.app.LoadedApk.makeApplication(LoadedApk.java:666)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6289) 
at android.app.ActivityThread.access$1800(ActivityThread.java:221) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1860) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:158) 
at android.app.ActivityThread.main(ActivityThread.java:7224) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Suppressed: java.lang.ClassNotFoundException: com.orm.SugarApp
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
This is my Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gigacycle.geoaudiotag">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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"
android:name="com.orm.SugarApp">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<meta-data android:name="DATABASE" android:value="geoaudiotagdb.db" />
<meta-data android:name="VERSION" android:value="2" />
<meta-data android:name="QUERY_LOG" android:value="true" />
<meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="gigacycle.geoaudiotag"/>
<activity
android:name="gigacycle.geoaudiotag.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
also this line is compiling successfully!
compile 'com.github.satyan:sugar:1.4'
I don't know why this fatal error occurred? where is my mistake?
Sync gradle and build.
Just download the package does not generate com.orm.SugarApp. Gradle sync will generate the class and before syncing, it appears as lint error in AndroidManifest.
Unfortunately this cannot be captured as compiler error and results in runtime error as you get.

Using Android Emulator (eclipse) fails to start the tic-tac-toe example

I am trying to test the tic-tac-toe in eclipse. It compiles and deploys to emulator device (AVD) but no matter what version of Android I use, the application deployed says: Application Stopped. Close it. Is there any specific setting I should follow?
Note: I already setup the Eclipse environment, add libraries, etc.
Thanks!
Here is the log error:
01-16 01:07:35.994: E/AndroidRuntime(883): FATAL EXCEPTION: main
01-16 01:07:35.994: E/AndroidRuntime(883): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.google.cast.samples.tictactoe/com.google.cast.samples.tictactoe.GameActivity}: java.lang.ClassNotFoundException: Didn't find class "com.google.cast.samples.tictactoe.GameActivity" on path: DexPathList[[zip file "/data/app/com.google.cast.samples.tictactoe-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.google.cast.samples.tictactoe-1, /system/lib]]
01-16 01:07:35.994: E/AndroidRuntime(883): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
01-16 01:07:35.994: E/AndroidRuntime(883): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
01-16 01:07:35.994: E/AndroidRuntime(883): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-16 01:07:35.994: E/AndroidRuntime(883): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.cast.samples.tictactoe.GameActivity" on path: DexPathList[[zip file "/data/app/com.google.cast.samples.tictactoe-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.google.cast.samples.tictactoe-1, /system/lib]]
01-16 01:07:35.994: E/AndroidRuntime(883): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
Thanks Ali. Here is the manifest, but I see there is a match of class and activity.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.cast.samples.tictactoe"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature
android:name="android.hardware.wifi"
android:required="true" >
</uses-feature>
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat" >
<activity
android:name=".GameActivity"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Exception states that it didn't find your GameActivity class. Check your Manifest and see if the name given there as the launcher activity (GameActivity) matches with the class that you have in your package, check the package names, etc. The exception has nothing to do (at least the piece that you have shown) with Cast.
Thanks for all the help. I solved by silly configuration. I created a libs folder and copied under GoogleCastSDKAndroid.jar (marked as Private Library). Compiled and it worked perfect!
Now, I just learned the casting function can't work because AVD runs a different IP address (in my case registered a 10.0.2.15) than my wifi segment (192.168.1.x). Therefore, the AVD can't see a chrome device.
I hope this last conclusion helps other people. The first was a mistake of configuration.

Categories

Resources