Unauthorized package "generated" in AndroidManifest.xml

In my Android Studio androidManifest.xml I found an unresolved package generated . How can i fix this?

Released Code: android:name=".provider.generated.SquawkProvider

 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.aaa"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <provider android:name=".provider.generated.SquawkProvider" <!-- shows unresolved package "generated" --> android:authorities="com.example.android.aaa.provider.provider" android:exported="false" > </provider> <activity android:name=".following.FollowingPreferenceActivity" android:parentActivityName=".MainActivity"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value=".MainActivity" /> </activity> <service android:name=".fcm.MyFirebaseMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service> </application> </manifest> 
+5
source share
3 answers

This issue is related to annotation processing, which is now included in Gradle from version 2.2. You can fix the project and run it with the following changes.

The project level "build.gradle" removes this line:

 classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2' 

The application level "build.gradle" removes this line:

 apply plugin: 'android-apt' 

and change this line by replacing apt with annotationProcessor :

 apt 'net.simonvt.schematic:schematic-compiler:0.6.3' 
+11
source

In build.gradle (Module: app) delete this two lines

1) At the top of the file

 apply plugin: 'android-apt' 

2) in dependencies

 apt 'net.simonvt.schematic:schematic-compiler:0.6.3' 

add this

 annotationProcessor 'net.simonvt.schematic:schematic-compiler:0.6.3' 
+2
source

Try the following: -

Go to “File” → “Invalid Caches” / “Restart”, then “Invalid” and “Restart”.

-2
source

Source: https://habr.com/ru/post/1272297/


All Articles