AWS Cognito and Android example - {"AppCognitoWebDomain":"invalid"} - android

Learning Cognito using the Android sample. As far as I can tell I have followed the example on the read me page here except for one thing... There is a section that I do not understand:
<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="YOUR_REDIRECT_URI_AUTHORITY"android:scheme="YOUR_REDIRECT_SCHEME"/>
</intent-filter>
What is the line:
android:host="YOUR_REDIRECT_URI_AUTHORITY"android:scheme="YOUR_REDIRECT_SCHEME"
The error I am getting in Android Studio is:
11-23 21:48:52.860
12915-12915/com.amazonaws.cognito.android.samples.authdemo
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.amazonaws.cognito.android.samples.authdemo, PID: 12915
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.amazonaws.cognito.android.samples.authdemo/com.amazonaws.cognito.android.samples.authdemo.MainActivity}:
com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthInvalidParameterException:
validation failed
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
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:
com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthInvalidParameterException:
validation failed
at
com.amazonaws.mobileconnectors.cognitoauth.Auth$Builder.validateCognitoAuthParameters(Auth.java:341)
at
com.amazonaws.mobileconnectors.cognitoauth.Auth$Builder.build(Auth.java:288)
at
com.amazonaws.cognito.android.samples.authdemo.MainActivity.initCognito(MainActivity.java:121)
at
com.amazonaws.cognito.android.samples.authdemo.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:6237)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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:
com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthInvalidParameterException:
{"AppCognitoWebDomain":"invalid"}
at
com.amazonaws.mobileconnectors.cognitoauth.Auth$Builder.validateCognitoAuthParameters(Auth.java:338)
at
com.amazonaws.mobileconnectors.cognitoauth.Auth$Builder.build(Auth.java:288) 
at
com.amazonaws.cognito.android.samples.authdemo.MainActivity.initCognito(MainActivity.java:121) 
at
com.amazonaws.cognito.android.samples.authdemo.MainActivity.onCreate(MainActivity.java:48) 
at android.app.Activity.performCreate(Activity.java:6237) 
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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) 

The host & scheme in intent filter data specify the Cognito app client's redirect URI. For details about data, see this. As for what do you configure in your app, see this example. So, if you use this example as your data then you would need to set your redirect_uri in Cognito Userpool console as demoapp://www.loginactivity.com/mainactivity. As for webdomain, you need to setup your Userpool domain in strings.xml.

Related

Why am I getting java.lang.NoClassDefFoundError when calling getDrawable?

I am trying to change the icon on a button inside a ListView at runtime, but when my code has calls to getDrawable, e.g.
getDrawable(android.R.drawable.ic_media_pause)
I get java.lang.NoClassDefFoundError from inside the activity's onCreate method. When I remove calls to getDrawable, the app runs fine.
01-29 18:31:43.526 30890-30890/com.p403n1x87.motee E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.p403n1x87.motee, PID: 30890
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/p403n1x87/motee/device/DeviceActivity$onCreate$adapter$1$1;
at com.p403n1x87.motee.device.DeviceActivity.onCreate(DeviceActivity.kt:40)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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.p403n1x87.motee.device.DeviceActivity$onCreate$adapter$1$1" on path: DexPathList[[zip file "/data/app/com.p403n1x87.motee-1/base.apk"],nativeLibraryDirectories=[/data/app/com.p403n1x87.motee-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 com.p403n1x87.motee.device.DeviceActivity.onCreate(DeviceActivity.kt:40) 
at android.app.Activity.performCreate(Activity.java:6251) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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.ClassNotFoundException: com.p403n1x87.motee.device.DeviceActivity$onCreate$adapter$1$1
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)
... 14 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
After seeing the same error when trying to get the intent from the activity inside an anonymous class instance, I realised that I should have explicitly requested the method from it, i.e. it.getDrawable. Given that the build process completes successfully, this looks like a Kotlin bug to me.

java.lang.RuntimeException: Unable to start activity ComponentInfo by library

I used this library https://github.com/liuguangqiang/IPicker
This is my code:
public void onClick(View view) {
switch (view.getId()) {
case R.id.ll_profile_pic_container:
IPicker.open(getApplicationContext(), selectPictures);
return;
...
}
This is the error I receive when in activity com.liuguangqiang.ipicker.IPickerActivity I select my image from the gallery:
java.lang.RuntimeException: Unable to start activity ComponentInfo{rp.com.bmicalculator/com.liuguangqiang.ipicker.crop.CropImageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setHomeAsUpIndicator(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
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.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setHomeAsUpIndicator(int)' on a null object reference
at com.liuguangqiang.ipicker.crop.CropImageActivity.initToolbar(CropImageActivity.java:116)
at com.liuguangqiang.ipicker.crop.CropImageActivity.onCreate(CropImageActivity.java:91)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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)
 I've followed all the directions I've provided from the library author ... Can the bug be in the library? No, because I've tested the app created by the same author and everything works perfectly ...
So, I installed the library you mentioned. Everything seems to work well. Maybe you are using AppTheme with no ActionBar?

Android - ResourceNotFoundException and NumberFormatException

I have created an app in which I've used android.support.v4.widget.DrawerLayout along with android.support.v7.widget.Toolbar.
When I run this app on a Samsung Tablet Neo (Android version 4.2.2), the app is running perfectly.
But when I run the same app on Google Nexus 5 (Android version 6.0.1), I'm getting ResourceNotFoundException and the app just crashes on the starting line of the following code in my Java (Activity) file.
The app crashes on this line: setSupportActionBar(topToolBar);
FATAL EXCEPTION: main
rocess: com.myapp, PID: 11761
va.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.MainActivityWithNavigationViewExpandableList}: android.content.res.Resources$NotFoundException: File res/color/abc_hint_foreground_material_dark.xml from color state list resource ID #0x7f0c00ab
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
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)
aused by: android.content.res.Resources$NotFoundException: File res/color/abc_hint_foreground_material_dark.xml from color state list resource ID #0x7f0c00ab
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2750)
at android.content.res.Resources.loadColorStateList(Resources.java:2699)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:485)
at android.widget.TextView.<init>(TextView.java:746)
at android.widget.TextView.<init>(TextView.java:671)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:62)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:58)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:54)
at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:756)
at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261)
at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243)
at android.support.v7.app.ToolbarActionBar.<init>(ToolbarActionBar.java:78)
at android.support.v7.app.AppCompatDelegateImplV9.setSupportActionBar(AppCompatDelegateImplV9.java:223)
at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:130)
at com.myapp.MainActivityWithNavigationViewExpandableList.onCreate(MainActivityWithNavigationViewExpandableList.java:64)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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) 
aused by: java.lang.NumberFormatException: Invalid float: "0.70000005dip"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.initialParse(StringToReal.java:164)
at java.lang.StringToReal.parseFloat(StringToReal.java:323)
at java.lang.Float.parseFloat(Float.java:306)
at android.content.res.TypedArray.getFloat(TypedArray.java:396)
at android.content.res.ColorStateList.inflate(ColorStateList.java:275)
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:222)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:201)
at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2746)
at android.content.res.Resources.loadColorStateList(Resources.java:2699) 
at android.content.res.TypedArray.getColorStateList(TypedArray.java:485) 
at android.widget.TextView.<init>(TextView.java:746) 
at android.widget.TextView.<init>(TextView.java:671) 
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:62) 
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:58) 
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:54) 
at android.support.v7.widget.Toolbar.setTitle(Toolbar.java:756) 
at android.support.v7.widget.ToolbarWidgetWrapper.setTitleInt(ToolbarWidgetWrapper.java:261) 
at android.support.v7.widget.ToolbarWidgetWrapper.setWindowTitle(ToolbarWidgetWrapper.java:243) 
at android.support.v7.app.ToolbarActionBar.<init>(ToolbarActionBar.java:78) 
at android.support.v7.app.AppCompatDelegateImplV9.setSupportActionBar(AppCompatDelegateImplV9.java:223) 
at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:130) 
at com.myapp.MainActivityWithNavigationViewExpandableList.onCreate(MainActivityWithNavigationViewExpandableList.java:64) 
at android.app.Activity.performCreate(Activity.java:6251) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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) 
I searched other SO answers as well.
The resource 'abc_hint_foreground_material_dark' is not in my 'color'. This resource should come from Support Library of Android, which I'm using in Android Studio.
abc_hint_foreground_material_dark is a link to the theme's foreground_material_dark, see here.
The NumberFormatException says that this color value is invalid ('Invalid float: "0.70000005dip"'). This value does not come from support library so must have been set by your resources (check colors.xml and values.xml). Color values should be hex integers and are not in dp or any other unit. See here for more info.
So finally I digged more in the issue and my suspect was NumberFormatException. I searched for decimal values in my dimens.xml file and commented them. And it worked fine now. Basically, Android was unable to parse the decimal values placed in dimens.xml file.

Android Google Sign In: Two different server Client id Provided

I am trying to integrate Google Sign-In on my Android application and website.
I integrated them separately, and while integrating it on website, I received a server client id through which I integrated the backend of it as well.
Now when integrating it in Android using Firebase and downloading the Google configuration Gson from console and passing the same server side client id in GoogleSignInoptions.requestIDToken, it crashes the app saying there are two server side id clients provided.
I am not really sure how to correct this. My error:
Process: com.example.ayush.bottomnavigation, PID: 23326
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ayush.bottomnavigation/com.example.ayush.bottomnavigation.SignInActivity}: java.lang.IllegalArgumentException: two different server client ids provided
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
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.IllegalArgumentException: two different server client ids provided
at com.google.android.gms.common.internal.zzab.zzb(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.zzfs(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.requestIdToken(Unknown Source)
at com.example.ayush.bottomnavigation.SignInActivity.onCreate(SignInActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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) 

AS app emulator crashing rendering problems

I am building an app for android, and so far things are going well.
The app runs fine in the emulator, until I decided to use a picture from the web, download it as .png and use it as my background image in the login screen.
In the xml code I simply, in the linearLayout set the background like this:
android:background="#drawable/login"
Which should be completely fine(login is the login.png file).
There is an error message saying
Rendering problems
-Paint.setShadowLayer is not supported
When I launch the app, the emulator starts and tries to start the app, however it immidiately quits and says "unfortunately, "appname" has stopped".
So the problem is the background image, but what can it be? Is using an image just like this directly a very naive method?
Thanks in advance!
Here is an image of the login activity before launching
Logcat error message:
12-16 19:53:39.538 2218-2218/com.example.koenraad.emergencyapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.koenraad.emergencyapp, PID: 2218
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.koenraad.emergencyapp/com.example.koenraad.Exigentia.LoginActivity}: android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
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: android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at com.example.koenraad.Exigentia.LoginActivity.onCreate(LoginActivity.java:72)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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: android.view.InflateException: Binary XML file line #1: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.example.koenraad.Exigentia.LoginActivity.onCreate(LoginActivity.java:72) 
at android.app.Activity.performCreate(Activity.java:6237) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.example.koenraad.Exigentia.LoginActivity.onCreate(LoginActivity.java:72) 
at android.app.Activity.performCreate(Activity.java:6237) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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.OutOfMemoryError: Failed to allocate a 82944012 byte allocation with 1048576 free bytes and 63MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1080)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2635)
at android.content.res.Resources.loadDrawable(Resources.java:2540)
at android.content.res.TypedArray.getDrawable(TypedArray.java:870)
at android.view.View.(View.java:3948)
at android.view.ViewGroup.(ViewGroup.java:573)
at android.widget.LinearLayout.(LinearLayout.java:203)
at android.widget.LinearLayout.(LinearLayout.java:199)
at android.widget.LinearLayout.(LinearLayout.java:195)
at java.lang.reflect.Constructor.newInstance(Native Method) 
at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) 
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
at com.example.koenraad.Exigentia.LoginActivity.onCreate(LoginActivity.java:72) 
at android.app.Activity.performCreate(Activity.java:6237) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
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) 
this is not an error it just tell you that the preview of code will not be the same as output
the problem must be something else,it could be the resolution of the image ,try to get the error from the logcat while testing the app

Categories

Resources