Reputation: 139
Hello im new to Android prorgamming, I currently expirence some problems with the Gradle Sync. I tried alot of things like rebuild/clean the project, but nothing seems to do the trick.
Here is the Gradle File,which produces the Sync problem :
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.fragment"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'me.dm7.barcodescanner:zxing:1.9'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:22.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
}
And here is the Error Message I get when , I Sync the Gradle:
Failed to parse XML in C:\Users\cbuch\AndroidProjects\FoodGentApp\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[19,13]
Message: expected start or end tag
Affected Modules: <a href="openFile:C:/Users/cbuch/AndroidProjects/FoodGentApp/app/build.gradle">app</a>
And last but not least my Manifest :
<?xml version="1.0" encoding="UTF-8"?>
-<manifest android:versionName="0.5" android:versionCode="1" package="com.example.fragment" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:targetSdkVersion="29" android:minSdkVersion="21"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds -->
<!-- <uses-sdk android:minSdkVersion="14"/> -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
-<application android:theme="@style/AppTheme" android:supportsRtl="true" android:label="@string/app_name" android:icon="@drawable/kuehli" android:debuggable="true" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:allowBackup="true">
-<activity android:name="com.example.foodgent.UserInterface.MainActivity" android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
-<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.example.foodgent.UserInterface.SecondActivity"/>
<activity android:name="com.example.foodgent.UserInterface.AddItem"/>
<activity android:name="com.example.foodgent.UserInterface.AddCooking"/>
<activity android:name="com.example.foodgent.UserInterface.AddShop"/>
<activity android:name="com.example.foodgent.Logic.ScanCodeActivity"/>
<meta-data android:name="preloaded_fonts" android:resource="@array/preloaded_fonts"/>
-<service android:name="com.google.firebase.components.ComponentDiscoveryService" android:exported="false" android:directBootAware="true">
<meta-data android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar" android:value="com.google.firebase.components.ComponentRegistrar"/>
</service>
<activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false" android:excludeFromRecents="true"/>
<!--Service handling Google Sign-In user revocation. For apps that do not integrate withGoogle Sign-In, this service will never be started. -->
<service android:name="com.google.android.gms.auth.api.signin.RevocationBoundService" android:exported="true" android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION"/>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false"/>
<provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:exported="false" android:initOrder="100" android:authorities="com.example.fragment.firebaseinitprovider"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
</application>
</manifest>
Upvotes: 0
Views: 221
Reputation: 6426
You are adding invalid tokens in your android.Manifest file. I have removed those tokens. Please try now:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fragment"
android:versionCode="1"
android:versionName="0.5">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds -->
<!-- <uses-sdk android:minSdkVersion="14"/> -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:appComponentFactory="androidx.core.app.CoreComponentFactory"
android:debuggable="true"
android:icon="@drawable/kuehli"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.example.foodgent.UserInterface.MainActivity"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.foodgent.UserInterface.SecondActivity" />
<activity android:name="com.example.foodgent.UserInterface.AddItem" />
<activity android:name="com.example.foodgent.UserInterface.AddCooking" />
<activity android:name="com.example.foodgent.UserInterface.AddShop" />
<activity android:name="com.example.foodgent.Logic.ScanCodeActivity" />
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
<service
android:name="com.google.firebase.components.ComponentDiscoveryService"
android:directBootAware="true"
android:exported="false">
<meta-data
android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
android:value="com.google.firebase.components.ComponentRegistrar" />
</service>
<activity
android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
android:excludeFromRecents="true"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!--Service handling Google Sign-In user revocation. For apps that do not integrate withGoogle Sign-In, this service will never be started. -->
<service
android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
android:exported="true"
android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.example.fragment.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
Upvotes: 1