image_cropper crashing the app in flutter - flutter

I have added image cropping library in my project image_cropper: ^1.5.1 with image_picker: ^0.8.4+11 . i picked the image with image picker and pass the image file to image cropper after selecting the file from gallery and passing it to image cropper the app is getting crashed with the following generated logs, This code is working fine in debug mode but in release it is getting crashed :
E/AndroidRuntime(16153): FATAL EXCEPTION: main
E/AndroidRuntime(16153): Process: com.testapp, PID: 16153
E/AndroidRuntime(16153): java.lang.IllegalAccessError: Illegal class access: 'androidx.appcompat.widget.Conten
tFrameLayout' attempting to access 'androidx.appcompat.app.w' (declaration of 'androidx.appcompat.widget.Conte
ntFrameLayout' appears in /data/app/~~z4bx5ponHbUNL1ta7qj5SA==/com.testapp-E-Oz7_lJH0IimHOXbiaftg==/base.apk)
E/AndroidRuntime(16153): at androidx.appcompat.widget.ContentFrameLayout.onAttachedToWindow(Unknown Source:7)
E/AndroidRuntime(16153): at android.view.View.dispatchAttachedToWindow(View.java:20626)
E/AndroidRuntime(16153): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3514)
E/AndroidRuntime(16153): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
E/AndroidRuntime(16153): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
E/AndroidRuntime(16153): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
E/AndroidRuntime(16153): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
E/AndroidRuntime(16153): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2702)
E/AndroidRuntime(16153): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2182)
E/AndroidRuntime(16153): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8730)
E/AndroidRuntime(16153): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1352)
E/AndroidRuntime(16153): at android.view.Choreographer.doCallbacks(Choreographer.java:1149)
E/AndroidRuntime(16153): at android.view.Choreographer.doFrame(Choreographer.java:1049)
E/AndroidRuntime(16153): at android.view.Choreographer$FrameHandler.handleMessage(Choreographer.java:1275)
E/AndroidRuntime(16153): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(16153): at android.os.Looper.loop(Looper.java:233)
E/AndroidRuntime(16153): at android.app.ActivityThread.main(ActivityThread.java:8010)
E/AndroidRuntime(16153): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16153): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/AndroidRuntime(16153): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
here is the code part :
final imgPicker.ImagePicker _picker = imgPicker.ImagePicker();
final imgPicker.XFile? images =
await _picker.pickImage(source: imgPicker.ImageSource.gallery);
try{
if (images != null) {
File? _cropped = await cropper.ImageCropper().cropImage(
sourcePath: images.path,
aspectRatioPresets: [
cropper.CropAspectRatioPreset.ratio16x9,
],
maxHeight: 250,
cropStyle: cropper.CropStyle.rectangle,
maxWidth: 1000,
androidUiSettings: cropper.AndroidUiSettings(
toolbarTitle: 'Crop your cover image',
toolbarColor: Kolors.kRed,
toolbarWidgetColor: Colors.white,
initAspectRatio: cropper.CropAspectRatioPreset.ratio16x9,
lockAspectRatio: true,
hideBottomControls: true),
iosUiSettings: cropper.IOSUiSettings(
minimumAspectRatio: 1.0,
aspectRatioLockEnabled: true,
),
);
if(_cropped != null) {
// cropped image code
}
} else {
showToast('Please select an image');
}
}
catch (e) {
log(e.toString());
}
whenever i select image from gallery after selection the app gets crashed, i tried removing the cropper part then it is working fine but when i user cropper my app get crashed.
here is the
Androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp">
<application
android:label="testapp"
android:requestLegacyExternalStorage="true"
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: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>
<meta-data android:name="flutter_deeplinking_enabled" android:value="true"/>
<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:scheme="https" android:host="app.testapp.com"/>
<!-- <data android:scheme="https" />-->
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
<!-- 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>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>

I got the same error previously.
Just cross-check if you have added UCropActivity into your AndroidManifest.xml
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
No configurations needed for iOS.

finally!! i have found the solution
go to android > app : right click on 'app' create a file name 'proguard-rules.pro'
add all of these following lines in the created file :
#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn org.xmlpull.v1.XmlPullParser
-dontwarn org.xmlpull.v1.XmlSerializer
-keep class org.xmlpull.v1.* {*;}
-keep class androidx.appcompat.** { *; }
now go to app/build.gradle and these lines inside the release block
signingConfig signingConfigs.debug
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
use flutter clean command, re-create the app in release mode and done!

Related

Flutter android alarm manager plus works in emulator periodically but not working in real device?

I am using flutter android alarm manager package to get local notifications periodically. It's working perfectly in the emulator but when I am generating an apk file and installing the app in a real android device through that apk file it's not showing any notification.
So, could anyone please help me sharing your precious experience. Thanks in advance!
Here you go with my code -
Future<void> notify() async {
try {
await Quote.saveNewQuote();
} catch (e) {
print(e.toString());
}
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 1,
channelKey: 'basic_notification',
title: 'Notification',
body: 'Android alarm manager periodical notification',
));
// await Quote.notifyLastQuote();
}
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AndroidAlarmManager.initialize();
await AwesomeNotifications().initialize('resource://drawable/fitjerk_logo',
[
NotificationChannel(
channelKey: 'basic_notification',
channelName: 'FitJerk Motivation',
channelDescription: "FitJerk Today Notification ",
defaultColor: primaryDeepColor,
importance: NotificationImportance.High,
ledColor: Colors.white,
playSound: true,
enableLights: true,
enableVibration: true
)
]);
await AndroidAlarmManager.periodic(const Duration(hours: 24), 1, notify,
///TODO: here will set startAt time///
startAt: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 30),
exact: true, wakeup: true, allowWhileIdle: true, rescheduleOnReboot: true);
And here is my AndroidMenifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.fit_jerk">
<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.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- For apps with targetSDK=31 (Android 12) -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
<application
android:label="FitJerk"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher"
tools:ignore="ExtraText">
<!-- this portion is for android alarm plus-->
<!-- android:name = "io.flutter.app.FlutterApplication"-->
<service
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"
tools:ignore="MissingClass" />
<receiver
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmBroadcastReceiver"
android:exported="false"
tools:ignore="MissingClass" />
<receiver
android:name="dev.fluttercommunity.plus.androidalarmmanager.RebootBroadcastReceiver"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".MainActivity"
android:exported="true"
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"
/>
<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" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
tools:ignore="MissingClass" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true"
tools:ignore="MissingClass">
<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/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-8656344449994415~3632328521"/>
</application>
</manifest>

Flutter App on play store showing error "Your device isn't compatible with this version"

Play Store keeps showing "Your device isn't compatible with this version".
I had referred to the following posts and have tried all possible ways to add/remove the permissions in Manifest file, however, I still couldn't get rid of the error in the Play Store.
My Flutter App Showing "Your device isn't compatible with this version
Your device isn't compatible with this version" but it installs via adb just fine on Nexus7
Just reaching out to you all for some solutions.
I am using Samsung S10 Android 12.
Here is my android/app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.firebase.crashlytics'
android.buildTypes.release.ndk.debugSymbolLevel = 'FULL'
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
// compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.someApp"
// minSdkVersion flutter.minSdkVersion
// targetSdkVersion flutter.targetSdkVersion
minSdkVersion 29
targetSdkVersion 33
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation "io.grpc:grpc-okhttp:1.32.2"
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.google.firebase:firebase-analytics'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}
Here is my android/app/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.someApp">
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
<!-- Permissions -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera"
android:required="false"/>
<!-- <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />-->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:label="#string/app_name"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
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"
/>
<!-- Local notification Start-->
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="someApp_channel" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- Local notification End-->
</activity>
<!-- Braintree Start-->
<activity
android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:exported="true"
android:launchMode="singleTask">
<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="${applicationId}.braintree" />
</intent-filter>
</activity>
<!-- Braintree End-->
<!-- Image Crop Start-->
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
<!-- Image Crop End-->
<!-- Google Pay Start-->
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true"/>
<!-- Google Pay End-->
<!-- Facebook Start-->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="someApp" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="#string/facebook_client_token"/>
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<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/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<!-- Facebook End-->
<!-- 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>

Mi android manifest.xml no reconoce los permisos

I have an app that uses a qrscan to obtain data and then does a service with the scanned data, the first time I tested it on a Redmi 9 if it asked for later permissions with other devices it no longer asked me for permissions, asking for the correct functioning of the library
this is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app_roja_rastreo_update">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:label="app_roja_rastreo_update"
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: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>
Try to use permission_handler in my code, to force the user to activate the permissions
but the console gave me this:
V/BoostFramework(28768): mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
V/BoostFramework(28768): mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
V/BoostFramework(28768): mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
V/BoostFramework(28768): mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
V/BoostFramework(28768): mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
V/BoostFramework(28768): BoostFramework() : mPerf = com.qualcomm.qti.Performance#4363c91
50
D/permissions_handler(28768): No permissions found in manifest for: []2
my code with the use of permission handler
#override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
var status = await Permission.camera.status;
//await Permission.contacts.request();
if(status.isDenied|| status.isRestricted||status.isPermanentlyDenied){
await Permission.contacts.request();
}
if (await Permission.contacts.request().isGranted) {
processQuery(context, await getCode());
}
},
child: Container(
decoration: BoxDecoration(
color: Colors.blue.shade700,
borderRadius: BorderRadius.circular(15)),
width: 60,
height: 60,
child: Icon(
Icons.qr_code,
color: Colors.white,
),
),
);
}

cannot find symbol public void configureFlutterEngine(#NonNull FlutterEngine flutterEngine)

I am getting this error while trying to register plugin in MainActivity.java file
Error log
: error: cannot find symbol
public void configureFlutterEngine(#NonNull FlutterEngine flutterEngine) {
^
MainActivity.java
package com.orsac.bluis;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity { #Override public void configureFlutterEngine(#NonNull FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine); }
}
In AndroidManifest.xml file, getting Unresolved class error in android:name=".UniappApplication" and android:name=".MainActivity"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.orsac.bluis">
<application
android:name=".UniappApplication" // Here
android:label="BLUIS"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity" // Here
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">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</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>
Things I Tried
Flutter clean
Flutter run
Invalidate caches and restart
You should import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
1- Update targetSdkVersion and compileSdkVersion to the latest and equal version in build.gradle(app level) under android section
2- Import these libraries in MainActivity
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.googlemobileads.GoogleMobileAdsPlugin;

Couldn't find class in spite of the fact that Dex is enabled

I am trying to migrate an app from Eclipse to the android studio I have just the files and the last person who was writing it in eclipse didn't export it for importing project. I have started a new project and manually imported the files and the lib files and tried to solve the errors till the program is now running with no Gradle errors. now I am in this situation that the dex in Gradle is enabled but when I run the program it is confused and tells me it doesn't recognize some classes.
this is my manifest file
<permission
android:name="com.company.MyProject.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<supports-screens android:smallScreens="true" />
<supports-screens android:normalScreens="true" />
<supports-screens android:largeScreens="true" />
<supports-screens android:xlargeScreens="true" />
<supports-screens android:anyDensity="true" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.company.MyProject.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.company.MyProject.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.company.MyProject.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name="com.company.MyProject.TruckApplication"
android:allowBackup="true"
android:icon="#drawable/MyProject_logo"
android:label="#string/app_name"
android:largeHeap="true"
android:sharedUserId="android.uid.system"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.company.MyProject.Authenticate_user_Activity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.company.MyProject.Login_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.SubmitWaiver_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepStopChoice"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<!--<activity-->
<!--android:name="com.company.MyProject.Surveyold_Activity"-->
<!--android:configChanges="keyboardHidden|orientation|screenSize"-->
<!--android:screenOrientation="portrait" >-->
<!--</activity>-->
<activity
android:name="com.company.MyProject.GetStops_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Load_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.AddComment_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
android:name="com.company.MyProject.StopDetail_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.CaptureImage_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Survey_Activity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.GetDirection_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Map_FragmentActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.TabBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.ShowStopList_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.company.MyProject.TransprentActivity"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustPan" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
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.company.MyProject" />
</intent-filter>
</receiver>
<service android:name="com.MyProject.Service.SyncService" >
</service>
<receiver android:name="com.MyProject.BrodcastReciver.NetworkStateReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name="com.company.MyProject.RepeatingAlarmService" />
<receiver android:name="com.company.MyProject.RepeatingAlaramCommunication" />
<receiver android:name="com.company.MyProject.ReaptingAlramNewStops" />
<service android:name="com.MyProject.Service.LogoutService" >
</service>
<service android:name="com.MyProject.Service.CallNewStop_Service" >
</service>
<service android:name="com.MyProject.Service.CheckingGooglePlayVersionService" >
</service>
<receiver
android:name="com.MyProject.BrodcastReciver.DateTimeChangeReceiver"
android:enabled="true"
android:exported="false" >
<intent_filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent_filter>
</receiver>
<!-- Start the Service if applicable on boot -->
<receiver android:name="com.MyProject.BrodcastReciver.PhoneReStartReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.company.MyProject.TruckLocationUpdateService"
android:enabled="true" />
<service
android:name="com.company.MyProject.TruckCommubicationcountService"
android:enabled="true" />
<service android:name="com.company.MyProject.GCMIntentService" />
<service android:name="com.company.MyProject.HandleNotification" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyB6Ae82d_eLZ1nMYIW7EaaQ3-2-Xn7duHs" />
<!-- android:value="AIzaSyAkZzWl6FSP89yWf7VeX6ooYvd6SuRnV4E" /> -->
</application>
<!--<uses-permission-->
<!--android:name="android.permission.ACCESS_MOCK_LOCATION"-->
<!--android:required="false" />-->
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-permission
android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal"
android:required="false" />
this is my gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.company.MyProject"
minSdkVersion 14
targetSdkVersion 25
versionCode 70
versionName "7.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// compile 'com.android.support:appcompat-v4:25'
testCompile 'junit:junit:4.12'
// compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.google.android.gms:play-services:10.2.1'
// compile "com.google.android.gms:play-services-gcm:10.2.1"
// compile 'org.apache.httpcomponents:httpmime:4.5.3'
// compile files('libs/gson-2.2.4.jar')
// compile files('libs/httpmime-4.2.2.jar')
// compile files('libs/joda-time-2.1.jar')
// compile files('libs/universal-image-loader-1.9.4.jar')
compile files('libs/android-support-v4.jar')
}
And this is my error log
AndroidRuntime: FATAL EXCEPTION: main
Process: com.company.MyProject, PID: 27974
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.MyProject/com.company.MyProject.Authenticate_user_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
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.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
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) 
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/MyProject/Interface/Authenticate_Interface;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
... 12 more
04-04 19:37:17.028 27974-27974/com.company.MyProject E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.MyProject.Interface.Authenticate_Interface" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 15 more
could you guys please help me to solve my problem.